drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adeneche <...@git.apache.org>
Subject [GitHub] drill pull request: DRILL-4287: During initial DrillTable creation...
Date Tue, 16 Feb 2016 17:15:27 GMT
Github user adeneche commented on a diff in the pull request:

    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetGroupScan.java
    @@ -529,6 +549,36 @@ public long getRowCount() {
    +  // Create and return a new file selection based on reading the metadata cache file.
    +  // This function also initializes a few of ParquetGroupScan's fields as appropriate.
    +  private FileSelection
    +  initFromMetadataCache(DrillFileSystem fs, FileSelection selection) throws IOException
    +    FileStatus metaRootDir = selection.getFirstPath(fs);
    +    Path metaFilePath = new Path(metaRootDir.getPath(), Metadata.METADATA_FILENAME);
    +    // get (and set internal field) the metadata for the directory by reading the metadata
    +    this.parquetTableMetadata = Metadata.readBlockMeta(fs, metaFilePath.toString());
    +    List<String> fileNames = Lists.newArrayList();
    +    for (Metadata.ParquetFileMetadata file : parquetTableMetadata.getFiles()) {
    +      fileNames.add(file.getPath());
    +    }
    +    // when creating the file selection, set the selection root in the form /a/b instead
    +    // file:/a/b.  The reason is that the file names above have been created in the form
    +    // /a/b/c.parquet and the format of the selection root must match that of the file
    +    // otherwise downstream operations such as partition pruning can break.
    +    final Path metaRootPath = Path.getPathWithoutSchemeAndAuthority(metaRootDir.getPath());
    +    this.selectionRoot = metaRootPath.toString();
    +    // Use the FileSelection constructor directly here instead of the FileSelection.create()
    +    // because create() changes the root to include the scheme and authority; In future,
if create()
    +    // is the preferred way to instantiate a file selection, we may need to do something
    +    FileSelection newSelection = new FileSelection(selection.getStatuses(fs), fileNames,
    --- End diff --
    Unfortunately, trying to fix this will introduce a performance regression, see [DRILL-4380](https://issues.apache.org/jira/browse/DRILL-4380)
for more details.

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.

View raw message