You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by pr...@apache.org on 2017/09/25 17:22:17 UTC
[3/4] drill git commit: DRILL-5438: Amazon S3 bucket can't be queried
directly at root
DRILL-5438: Amazon S3 bucket can't be queried directly at root
closes #952
Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/3d8f6993
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/3d8f6993
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/3d8f6993
Branch: refs/heads/master
Commit: 3d8f69935458da6eccd324e1add0900209fb2e8a
Parents: dde6fb7
Author: Korn, Uwe <Uw...@blue-yonder.com>
Authored: Thu Sep 21 14:52:58 2017 +0200
Committer: Paul Rogers <pr...@maprtech.com>
Committed: Mon Sep 25 09:38:34 2017 -0700
----------------------------------------------------------------------
.../main/java/org/apache/drill/exec/store/dfs/FileSelection.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/drill/blob/3d8f6993/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSelection.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSelection.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSelection.java
index 7cabee0..81c7ad2 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSelection.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSelection.java
@@ -362,6 +362,10 @@ public class FileSelection {
int idx = root.indexOf(WILD_CARD); // first wild card in the path
idx = root.lastIndexOf('/', idx); // file separator right before the first wild card
final String newRoot = root.substring(0, idx);
+ if (newRoot.length() == 0) {
+ // Ensure that we always return a valid root.
+ return new Path("/");
+ }
return new Path(newRoot);
} else {
return new Path(root);