You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/06/08 09:46:09 UTC

[GitHub] [pulsar] 315157973 commented on a change in pull request #6868: [issue #6765] Expose definition flags to function

315157973 commented on a change in pull request #6868:
URL: https://github.com/apache/pulsar/pull/6868#discussion_r436577000



##########
File path: pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/TopicSchema.java
##########
@@ -158,6 +173,20 @@ private static SchemaType getDefaultSchemaType(Class<?> clazz) {
         }
     }
 
+    private static <T> AvroSchema<T> buildAvroSchema(Class<T> clazz, ConsumerConfig conf) {
+        String jsr310ConversionEnabled = null;
+        String alwaysAllowNull = null;
+        if (conf.getSchemaProperties() != null) {

Review comment:
       > Please use `SchemaDefinitionBuilder#withProperties` to construct the schema definition and avoid adding this kind of customization code. Also, the schema properties should be passed to other schemas as well.
   
   Modify as follows:
   1 Since the map generated by protobuf is immutable, a new Map is added to TopicSchema line 161.
   2 Since the parameters such as JSR310 in SchemaDefinitionBuilder are underlined,the incoming parameters will be converted
   




----------------------------------------------------------------
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:
users@infra.apache.org