You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/05/20 00:51:01 UTC

[GitHub] [incubator-pinot] yupeng9 commented on a change in pull request #6946: Add collectionToJsonMode to schema inference

yupeng9 commented on a change in pull request #6946:
URL: https://github.com/apache/incubator-pinot/pull/6946#discussion_r635673571



##########
File path: pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroUtils.java
##########
@@ -134,18 +136,19 @@ public static Schema getPinotSchemaFromAvroDataFile(File avroDataFile)
    * @param complexType if allows complex-type handling
    * @param unnestFields the fields to unnest
    * @param delimiter the delimiter separating components in nested structure
+   * @param collectionToJsonMode to mode of converting collection to JSON string
    * @return Pinot schema
    */
   public static Schema getPinotSchemaFromAvroSchemaFile(File avroSchemaFile,
       @Nullable Map<String, FieldSpec.FieldType> fieldTypeMap, @Nullable TimeUnit timeUnit, boolean complexType,
-      List<String> unnestFields, String delimiter)
+      List<String> unnestFields, String delimiter, ComplexTypeConfig.CollectionToJsonMode collectionToJsonMode)

Review comment:
       # 1. But these are parsed from command-line configs? 
   # 2 I thought about `convertCollectionNotUnnestedToJson`, but feel it's a bit verbose :)

##########
File path: pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroUtils.java
##########
@@ -134,18 +136,19 @@ public static Schema getPinotSchemaFromAvroDataFile(File avroDataFile)
    * @param complexType if allows complex-type handling
    * @param unnestFields the fields to unnest
    * @param delimiter the delimiter separating components in nested structure
+   * @param collectionToJsonMode to mode of converting collection to JSON string
    * @return Pinot schema
    */
   public static Schema getPinotSchemaFromAvroSchemaFile(File avroSchemaFile,
       @Nullable Map<String, FieldSpec.FieldType> fieldTypeMap, @Nullable TimeUnit timeUnit, boolean complexType,
-      List<String> unnestFields, String delimiter)
+      List<String> unnestFields, String delimiter, ComplexTypeConfig.CollectionToJsonMode collectionToJsonMode)

Review comment:
        1. But these are parsed from command-line configs? 
    2 I thought about `convertCollectionNotUnnestedToJson`, but feel it's a bit verbose :)




-- 
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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org