jon-wei commented on a change in pull request #6360: overhaul 
'druid-parquet-extensions' module, promoting from 'contrib' to 'core'
URL: https://github.com/apache/incubator-druid/pull/6360#discussion_r224635556
 
 

 ##########
 File path: 
extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroFlattenerMaker.java
 ##########
 @@ -50,13 +50,37 @@
   private static final EnumSet<Schema.Type> ROOT_TYPES = EnumSet.of(
       Schema.Type.STRING,
       Schema.Type.BYTES,
-      Schema.Type.ARRAY,
       Schema.Type.INT,
       Schema.Type.LONG,
       Schema.Type.FLOAT,
       Schema.Type.DOUBLE
   );
 
+  private static boolean isPrimitive(Schema schema)
+  {
+    return ROOT_TYPES.contains(schema.getType());
+  }
+  private static boolean isPrimitiveArray(Schema schema)
+  {
+    return schema.getType().equals(Schema.Type.ARRAY) && 
isPrimitive(schema.getElementType());
+  }
+
+  private static boolean isOptionalPrimitive(Schema schema)
+  {
+    return schema.getType().equals(Schema.Type.UNION) &&
+           schema.getTypes().size() == 2 &&
+           schema.getTypes().get(0).getType().equals(Schema.Type.NULL) &&
 
 Review comment:
   hm, from that it sounds like [primitive, null] is valid if the default is 
non-null then, can you make this check non-order dependent?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to