Ben-Zvi commented on a change in pull request #1667: DRILL-7069: Moved version 
checks outside loops in transformBinaryInMetadataCache
URL: https://github.com/apache/drill/pull/1667#discussion_r261742197
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetReaderUtility.java
 ##########
 @@ -292,30 +294,47 @@ public static void 
transformBinaryInMetadataCache(ParquetTableMetadataBase parqu
     Set<List<String>> columnsNames = 
getBinaryColumnsNames(parquetTableMetadata);
     boolean allowBinaryMetadata = 
allowBinaryMetadata(parquetTableMetadata.getDrillVersion(), readerConfig);
 
+    // Setting Min / Max values for ParquetTableMetadata_v1
+    if (new MetadataVersion(1, 0).equals(new 
MetadataVersion(parquetTableMetadata.getMetadataVersion()))) {
+      for (ParquetFileMetadata file : parquetTableMetadata.getFiles()) {
+        for (RowGroupMetadata rowGroupMetadata : file.getRowGroups()) {
+          Long rowCount = rowGroupMetadata.getRowCount();
+          for (ColumnMetadata columnMetadata : rowGroupMetadata.getColumns()) {
+              if (columnMetadata.getPrimitiveType() == 
PrimitiveTypeName.BINARY || columnMetadata.getPrimitiveType() == 
PrimitiveTypeName.FIXED_LEN_BYTE_ARRAY) {
+                setMinMaxValues(columnMetadata, rowCount, allowBinaryMetadata, 
false);
+              }
+          }
+        }
+      }
+      return;
+    }
+
+    // Variables needed for debugging only
+    Stopwatch timer = logger.isDebugEnabled() ? Stopwatch.createStarted() : 
null;
+    int maxRowGroups = 0, minRowGroups = 99999, maxNumColumns = 0;
 
 Review comment:
   Done.

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

Reply via email to