Return-Path: X-Original-To: apmail-drill-dev-archive@www.apache.org Delivered-To: apmail-drill-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6603318C3E for ; Fri, 20 Nov 2015 03:27:49 +0000 (UTC) Received: (qmail 68485 invoked by uid 500); 20 Nov 2015 03:27:49 -0000 Delivered-To: apmail-drill-dev-archive@drill.apache.org Received: (qmail 68436 invoked by uid 500); 20 Nov 2015 03:27:49 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 68423 invoked by uid 99); 20 Nov 2015 03:27:48 -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; Fri, 20 Nov 2015 03:27:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7637FE1809; Fri, 20 Nov 2015 03:27:48 +0000 (UTC) From: adeneche To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request: DRILL-2618: handle queries over empty folders ... Content-Type: text/plain Message-Id: <20151120032748.7637FE1809@git1-us-west.apache.org> Date: Fri, 20 Nov 2015 03:27:48 +0000 (UTC) Github user adeneche commented on a diff in the pull request: https://github.com/apache/drill/pull/270#discussion_r45432737 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSelection.java --- @@ -190,22 +136,40 @@ private static String commonPath(FileStatus... paths) { break; } } - URI oneURI = paths[0].getPath().toUri(); + URI oneURI = statuses.get(0).getPath().toUri(); return new Path(oneURI.getScheme(), oneURI.getAuthority(), commonPath).toString(); } - public static FileSelection create(DrillFileSystem fs, String parent, String path) throws IOException { - Path p = new Path(parent,removeLeadingSlash(path)); - FileStatus[] status = fs.globStatus(p); - if (status == null || status.length == 0) { + public static FileSelection create(final DrillFileSystem fs, final String parent, final String path) throws IOException { + final Path combined = new Path(parent, removeLeadingSlash(path)); + final FileStatus[] statuses = fs.globStatus(combined); + if (statuses == null) { --- End diff -- if statuses is empty (but not null), we will call create below passing an empty statuses list and a null files list which will cause the precondition of the method to fail, right ? --- 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. ---