From commits-return-5167-apmail-drill-commits-archive=drill.apache.org@drill.apache.org Mon Sep 25 17:22:16 2017 Return-Path: X-Original-To: apmail-drill-commits-archive@www.apache.org Delivered-To: apmail-drill-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5863010E03 for ; Mon, 25 Sep 2017 17:22:16 +0000 (UTC) Received: (qmail 96227 invoked by uid 500); 25 Sep 2017 17:22:16 -0000 Delivered-To: apmail-drill-commits-archive@drill.apache.org Received: (qmail 96109 invoked by uid 500); 25 Sep 2017 17:22:16 -0000 Mailing-List: contact commits-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: commits@drill.apache.org Delivered-To: mailing list commits@drill.apache.org Received: (qmail 96083 invoked by uid 99); 25 Sep 2017 17:22:16 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Sep 2017 17:22:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2E374F5744; Mon, 25 Sep 2017 17:22:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: progers@apache.org To: commits@drill.apache.org Date: Mon, 25 Sep 2017 17:22:17 -0000 Message-Id: In-Reply-To: <906adc4332d048c3aba100e7821e02b9@git.apache.org> References: <906adc4332d048c3aba100e7821e02b9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [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 Authored: Thu Sep 21 14:52:58 2017 +0200 Committer: Paul Rogers 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);