drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arina-ielchiieva <...@git.apache.org>
Subject [GitHub] drill pull request #877: DRILL-5660: Drill 1.10 queries fail due to Parquet ...
Date Fri, 21 Jul 2017 07:20:52 GMT
Github user arina-ielchiieva commented on a diff in the pull request:

    https://github.com/apache/drill/pull/877#discussion_r128697735
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/Metadata.java
---
    @@ -132,23 +135,57 @@ public static ParquetTableMetadata_v3 getParquetTableMetadata(FileSystem
fs,
       }
     
       /**
    -   * Get the parquet metadata for a directory by reading the metadata file
    +   * Get the parquet metadata for the table by reading the metadata file
        *
    -   * @param fs
    +   * @param fs current file system
        * @param path The path to the metadata file, located in the directory that contains
the parquet files
    -   * @return
    -   * @throws IOException
    +   * @param metaContext metadata context
    +   * @param formatConfig parquet format plugin configs
    +   * @return parquet table metadata
    +   * @throws IOException if metadata file can't be read or updated
        */
    -  public static ParquetTableMetadataBase readBlockMeta(FileSystem fs, String path, MetadataContext
metaContext, ParquetFormatConfig formatConfig) throws IOException {
    -    Metadata metadata = new Metadata(fs, formatConfig);
    -    metadata.readBlockMeta(path, false, metaContext);
    -    return metadata.parquetTableMetadata;
    +  public static @Nullable ParquetTableMetadataBase readBlockMeta(FileSystem fs, Path
path, MetadataContext metaContext,
    +      ParquetFormatConfig formatConfig) {
    +    if (metaContext.isMetaCacheFileCorrect) {
    +      Metadata metadata = new Metadata(fs, formatConfig);
    +      try {
    +        metadata.readBlockMeta(path, false, metaContext);
    +        return metadata.parquetTableMetadata;
    +      } catch (IOException e) {
    +        logger.error(e.toString());
    +        metaContext.isMetaCacheFileCorrect = false;
    +      }
    +    }
    +    logger.warn("Ignoring unsupported or corrupted metadata file version. Query performance
may be slow. Make sure " +
    +        "the cache file is up-to-date by running the REFRESH TABLE METADATA command");
    +    return null;
       }
     
    -  public static ParquetTableMetadataDirs readMetadataDirs(FileSystem fs, String path,
MetadataContext metaContext, ParquetFormatConfig formatConfig) throws IOException {
    -    Metadata metadata = new Metadata(fs, formatConfig);
    -    metadata.readBlockMeta(path, true, metaContext);
    -    return metadata.parquetTableMetadataDirs;
    +  /**
    +   * Get the parquet metadata for all subdirectories by reading the metadata file
    +   *
    +   * @param fs current file system
    +   * @param path The path to the metadata file, located in the directory that contains
the parquet files
    +   * @param metaContext metadata context
    +   * @param formatConfig parquet format plugin configs
    +   * @return parquet metadata for a directory
    +   * @throws IOException if metadata file can't be read or updated
    +   */
    +  public static @Nullable ParquetTableMetadataDirs readMetadataDirs(FileSystem fs, Path
path,
    +      MetadataContext metaContext, ParquetFormatConfig formatConfig) {
    +    if (metaContext.isMetaDirsCacheFileCorrect) {
    +      Metadata metadata = new Metadata(fs, formatConfig);
    +      try {
    +        metadata.readBlockMeta(path, true, metaContext);
    +        return metadata.parquetTableMetadataDirs;
    +      } catch (IOException e) {
    +        logger.error(e.toString());
    --- End diff --
    
    The same as above.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message