drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adeneche <...@git.apache.org>
Subject [GitHub] drill pull request: DRILL-2618: handle queries over empty folders ...
Date Fri, 20 Nov 2015 03:27:48 GMT
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.
---

Mime
View raw message