drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hnfgns <...@git.apache.org>
Subject [GitHub] drill pull request: DRILL-2618: handle queries over empty folders ...
Date Fri, 20 Nov 2015 01:51:12 GMT
Github user hnfgns commented on a diff in the pull request:

    https://github.com/apache/drill/pull/270#discussion_r45427970
  
    --- 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 --
    
    We handle null case explicitly here as we cannot create a List down when statuses is null.
In case statuses is empty, the delegate create returns `null` which is expected. Can you clarify
what you mean by failure?


---
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