sijie commented on a change in pull request #4022: Making use of builtin
schemas for primitive types
URL: https://github.com/apache/pulsar/pull/4022#discussion_r274251984
##########
File path:
pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarRecordCursor.java
##########
@@ -161,6 +161,47 @@ private SchemaHandler getSchemaHandler(Schema schema,
SchemaType schemaType,
case AVRO:
schemaHandler = new AvroSchemaHandler(schema, columnHandles);
break;
+ case STRING:
Review comment:
The reason why you are adding the avro schema into primitive schemas is
because the method is taking avro schema. However if you just look into your
implementation, primitive schemas don't use schema. so the logic should be
changed.
```
private SchemaHandler getSchemaHandler(SchemaInfo schemaInfo) {
return new PrestoSchemaHandler(Schema.getSchema(schemaInfo));
}
```
in this way, pulsar schema handles how to instantiate schema instance using
schema info. It also simplifies the implementation in presto and allow picking
up changes from schema part.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services