drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prog...@apache.org
Subject [3/4] drill git commit: DRILL-5438: Amazon S3 bucket can't be queried directly at root
Date Mon, 25 Sep 2017 17:22:17 GMT
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 <Uwe.Korn@blue-yonder.com>
Authored: Thu Sep 21 14:52:58 2017 +0200
Committer: Paul Rogers <progers@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);


Mime
View raw message