You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by parthchandra <gi...@git.apache.org> on 2016/02/09 22:18:01 UTC

[GitHub] drill pull request: DRILL-4380: Fix performance regression: in cre...

GitHub user parthchandra opened a pull request:

    https://github.com/apache/drill/pull/369

    DRILL-4380: Fix performance regression: in creation of FileSelection …

    …in ParquetFormatPlugin to not set files if metadata cache is available.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/parthchandra/incubator-drill DRILL-4380

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/drill/pull/369.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #369
    
----
commit be374c12992ef581a285b0a260bb9ad037d6df92
Author: Parth Chandra <pa...@apache.org>
Date:   2015-12-18T00:30:42Z

    DRILL-4380: Fix performance regression: in creation of FileSelection in ParquetFormatPlugin to not set files if metadata cache is available.

----


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

[GitHub] drill pull request: DRILL-4380: Fix performance regression: in cre...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/drill/pull/369


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

[GitHub] drill pull request: DRILL-4380: Fix performance regression: in cre...

Posted by jacques-n <gi...@git.apache.org>.
Github user jacques-n commented on a diff in the pull request:

    https://github.com/apache/drill/pull/369#discussion_r52376878
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSelection.java ---
    @@ -183,12 +194,16 @@ private static String buildPath(final String[] path, final int folderIndex) {
       }
     
       public static FileSelection create(final DrillFileSystem fs, final String parent, final String path) throws IOException {
    +    Stopwatch timer = Stopwatch.createStarted();
         final Path combined = new Path(parent, removeLeadingSlash(path));
         final FileStatus[] statuses = fs.globStatus(combined);
         if (statuses == null) {
           return null;
         }
    -    return create(Lists.newArrayList(statuses), null, combined.toUri().toString());
    +    final FileSelection fileSel = create(Lists.newArrayList(statuses), null, combined.toUri().toString());
    +    logger.info("FileSelection.create() took {} ms ", timer.elapsed(TimeUnit.MILLISECONDS));
    --- End diff --
    
    INFO => DEBUG


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

[GitHub] drill pull request: DRILL-4380: Fix performance regression: in cre...

Posted by adeneche <gi...@git.apache.org>.
Github user adeneche commented on a diff in the pull request:

    https://github.com/apache/drill/pull/369#discussion_r52377202
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSelection.java ---
    @@ -118,7 +126,10 @@ public boolean apply(@Nullable FileStatus status) {
           }
         }));
     
    -    return create(nonDirectories, null, selectionRoot);
    +    final FileSelection fileSel = create(nonDirectories, null, selectionRoot);
    +    logger.info("FileSelection.minusDirectories() took {} ms, numFiles: {}",
    --- End diff --
    
    minusDirectories() ?


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

[GitHub] drill pull request: DRILL-4380: Fix performance regression: in cre...

Posted by parthchandra <gi...@git.apache.org>.
Github user parthchandra commented on a diff in the pull request:

    https://github.com/apache/drill/pull/369#discussion_r52379092
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFormatPlugin.java ---
    @@ -233,7 +233,7 @@ private FileSelection expandSelection(DrillFileSystem fs, FileSelection selectio
             // /a/b/c.parquet and the format of the selection root must match that of the file names
             // otherwise downstream operations such as partition pruning can break.
             final Path metaRootPath = Path.getPathWithoutSchemeAndAuthority(metaRootDir.getPath());
    -        final FileSelection newSelection = FileSelection.create(null, fileNames, metaRootPath.toString());
    +        final FileSelection newSelection = new FileSelection(selection.getStatuses(fs), fileNames, metaRootPath.toString());
    --- End diff --
    
    Agreed. Hanifi made the change to the api initially with exactly that in mind. This patch reverts that partially. He's logging a new Jira to fix the api and document usage.


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

[GitHub] drill pull request: DRILL-4380: Fix performance regression: in cre...

Posted by jacques-n <gi...@git.apache.org>.
Github user jacques-n commented on the pull request:

    https://github.com/apache/drill/pull/369#issuecomment-182081851
  
    Other than INFO => DEBUG, +1


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

[GitHub] drill pull request: DRILL-4380: Fix performance regression: in cre...

Posted by jacques-n <gi...@git.apache.org>.
Github user jacques-n commented on a diff in the pull request:

    https://github.com/apache/drill/pull/369#discussion_r52376249
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSelection.java ---
    @@ -73,13 +75,18 @@ public String getSelectionRoot() {
       }
     
       public List<FileStatus> getStatuses(final DrillFileSystem fs) throws IOException {
    -    if (statuses == null) {
    +    Stopwatch timer = Stopwatch.createStarted();
    +
    +    if (statuses == null)  {
           final List<FileStatus> newStatuses = Lists.newArrayList();
           for (final String pathStr:files) {
             newStatuses.add(fs.getFileStatus(new Path(pathStr)));
           }
           statuses = newStatuses;
         }
    +    logger.info("FileSelection.getStatuses() took {} ms, numFiles: {}",
    --- End diff --
    
    DEBUG?


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

[GitHub] drill pull request: DRILL-4380: Fix performance regression: in cre...

Posted by hnfgns <gi...@git.apache.org>.
Github user hnfgns commented on a diff in the pull request:

    https://github.com/apache/drill/pull/369#discussion_r52378537
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFormatPlugin.java ---
    @@ -233,7 +233,7 @@ private FileSelection expandSelection(DrillFileSystem fs, FileSelection selectio
             // /a/b/c.parquet and the format of the selection root must match that of the file names
             // otherwise downstream operations such as partition pruning can break.
             final Path metaRootPath = Path.getPathWithoutSchemeAndAuthority(metaRootDir.getPath());
    -        final FileSelection newSelection = FileSelection.create(null, fileNames, metaRootPath.toString());
    +        final FileSelection newSelection = new FileSelection(selection.getStatuses(fs), fileNames, metaRootPath.toString());
    --- End diff --
    
    Whole point of making this c'tor non public was to centralize creation via FileSelection.create(...). Looks like we need more explicit comments over here. For this patch, a public c'tor seems not required as well. FileSelection.create(selections, null, root) should do the trick.


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

[GitHub] drill pull request: DRILL-4380: Fix performance regression: in cre...

Posted by hnfgns <gi...@git.apache.org>.
Github user hnfgns commented on a diff in the pull request:

    https://github.com/apache/drill/pull/369#discussion_r52383230
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFormatPlugin.java ---
    @@ -233,7 +233,7 @@ private FileSelection expandSelection(DrillFileSystem fs, FileSelection selectio
             // /a/b/c.parquet and the format of the selection root must match that of the file names
             // otherwise downstream operations such as partition pruning can break.
             final Path metaRootPath = Path.getPathWithoutSchemeAndAuthority(metaRootDir.getPath());
    -        final FileSelection newSelection = FileSelection.create(null, fileNames, metaRootPath.toString());
    +        final FileSelection newSelection = new FileSelection(selection.getStatuses(fs), fileNames, metaRootPath.toString());
    --- End diff --
    
    Filed DRILL-4381. Thanks.


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

[GitHub] drill pull request: DRILL-4380: Fix performance regression: in cre...

Posted by jacques-n <gi...@git.apache.org>.
Github user jacques-n commented on a diff in the pull request:

    https://github.com/apache/drill/pull/369#discussion_r52376432
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFormatPlugin.java ---
    @@ -233,7 +233,7 @@ private FileSelection expandSelection(DrillFileSystem fs, FileSelection selectio
             // /a/b/c.parquet and the format of the selection root must match that of the file names
             // otherwise downstream operations such as partition pruning can break.
             final Path metaRootPath = Path.getPathWithoutSchemeAndAuthority(metaRootDir.getPath());
    -        final FileSelection newSelection = FileSelection.create(null, fileNames, metaRootPath.toString());
    +        final FileSelection newSelection = new FileSelection(selection.getStatuses(fs), fileNames, metaRootPath.toString());
    --- End diff --
    
    It seems like we keep having issues with misuse of this interface which causes planning regressions. Do you think it makes sense to either change the api or add additional comments to make sure people aren't doing the wrong thing?


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

[GitHub] drill pull request: DRILL-4380: Fix performance regression: in cre...

Posted by jacques-n <gi...@git.apache.org>.
Github user jacques-n commented on a diff in the pull request:

    https://github.com/apache/drill/pull/369#discussion_r52376311
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSelection.java ---
    @@ -118,7 +126,10 @@ public boolean apply(@Nullable FileStatus status) {
           }
         }));
     
    -    return create(nonDirectories, null, selectionRoot);
    +    final FileSelection fileSel = create(nonDirectories, null, selectionRoot);
    +    logger.info("FileSelection.minusDirectories() took {} ms, numFiles: {}",
    --- End diff --
    
    same, DEBUG seems more appropriate.


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