ihuzenko commented on a change in pull request #1954: DRILL-7509: Incorrect 
TupleSchema is created for DICT column when querying Parquet files
URL: https://github.com/apache/drill/pull/1954#discussion_r366449441
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetReaderUtility.java
 ##########
 @@ -737,7 +737,13 @@ public static boolean 
containsComplexColumn(ParquetMetadata footer, List<SchemaP
       if (type == OriginalType.MAP) {
         TypeProtos.MajorType drillType = TypeProtos.MajorType.newBuilder()
             .setMinorType(TypeProtos.MinorType.DICT)
-            .setMode(TypeProtos.DataMode.OPTIONAL)
+            .setMode(TypeProtos.DataMode.REQUIRED)
+            .build();
+        result.add(drillType);
+      } else if (type == OriginalType.LIST) {
+        TypeProtos.MajorType drillType = TypeProtos.MajorType.newBuilder()
+            .setMinorType(TypeProtos.MinorType.LIST)
+            .setMode(TypeProtos.DataMode.REQUIRED)
 
 Review comment:
   Please update javadoc for this method. Also, loop may be shortened to : 
   ```java
       for (OriginalType type : originalTypes) {
         if (type == OriginalType.MAP) {
           result.add(Types.required(TypeProtos.MinorType.DICT));
         } else if (type == OriginalType.LIST) {
           result.add(Types.required(TypeProtos.MinorType.LIST));
         } else {
           result.add(null);
         }
       }
   ```

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


With regards,
Apache Git Services

Reply via email to