Github user vvysotskyi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/805#discussion_r118203553
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetReaderUtility.java
 ---
    @@ -181,6 +185,71 @@ else if (parquetTableMetadata instanceof 
Metadata.ParquetTableMetadata_v2 &&
       }
     
       /**
    +   * Checks that the metadata file was created by drill with version less 
than
    +   * the version where was changed the serialization of BINARY values
    +   * and assigns byte arrays to min/max values obtained from the 
deserialized string.
    +   *
    +   * @param parquetTableMetadata table metadata that should be corrected
    +   */
    +  public static void 
correctBinaryInMetadataCache(Metadata.ParquetTableMetadataBase 
parquetTableMetadata) {
    +    if (hasOldBinarySerialization(parquetTableMetadata)) {
    +      Set<List<String>> names = Sets.newHashSet();
    +      if (parquetTableMetadata instanceof 
Metadata.ParquetTableMetadata_v2) {
    +        for (Metadata.ColumnTypeMetadata_v2 columnTypeMetadata :
    +            ((Metadata.ParquetTableMetadata_v2) 
parquetTableMetadata).columnTypeInfo.values()) {
    +          if (columnTypeMetadata.primitiveType == 
PrimitiveTypeName.BINARY) {
    +            names.add(Arrays.asList(columnTypeMetadata.name));
    +          }
    +        }
    +      }
    +      for (Metadata.ParquetFileMetadata file : 
parquetTableMetadata.getFiles()) {
    +        // Drill has only ever written a single row group per file, only 
need to correct the statistics
    +        // on the first row group
    +        Metadata.RowGroupMetadata rowGroupMetadata = 
file.getRowGroups().get(0);
    --- End diff --
    
    Thanks, fixed it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to