You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2019/03/01 11:36:10 UTC

[GitHub] vvysotskyi commented on a change in pull request #1667: DRILL-7069: Moved version checks outside loops in transformBinaryInMetadataCache

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

 ##########
 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:
   Please declare each variable in a separate line. Also please replace `99999` with `Integer.MAX_VALUE` and `0` with `Integer.MIN_VALUE`

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


With regards,
Apache Git Services