-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[Pulsar SQL] Some optimized points in PR 8422 #9224
Copy link
Copy link
Closed
Labels
area/sqlPulsar SQL related featuresPulsar SQL related featuresgood first issueGood for newcomersGood for newcomershelp wantedtype/enhancementThe enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messagesThe enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Description
Activity
Metadata
Metadata
Assignees
Labels
area/sqlPulsar SQL related featuresPulsar SQL related featuresgood first issueGood for newcomersGood for newcomershelp wantedtype/enhancementThe enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messagesThe enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Motivation
The #8422 made a refactor for the Pulsar SQL, it's a major change. There are some points that could be considered to optimize.
1. PulsarRowDecoderFactory
The various decoder factories could be initialized at the Pulsar SQL beginning, one time is enough and they could be reused.
Refer to the method
private PulsarRowDecoderFactory createDecoderFactory(SchemaInfo schemaInfo)of the classPulsarDispatchingRowDecoderFactory.2. PulsarRowDecoderFactory
It seems that the multi-version schema decoder cache could be added and the decoders could be reused.
Refer to the method
PulsarRowDecoder createRowDecoder(TopicName topicName, SchemaInfo schemaInfo, Set<DecoderColumnHandle> columns)in classPulsarRowDecoderFactory.3. Internal Column decode optimize
The
switch-caseis more efficient thanif-elseand the PulsarInternalColumn could be changed to an enum.