Closed gaoran10 closed 1 year ago
@codelipenghui I want to fix this issues.
The issue had no activity for 30 days, mark with Stale label.
Kindly to ask if there is somebody working for this issue? lf not, I'm glad to undertake it
@ziang123 I think no one is working on this issue yet. Go ahead!
Closed by #19027.
@ziang123 Thanks for your contribution!
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-case
is more efficient thanif-else
and the PulsarInternalColumn could be changed to an enum.