[ 
https://issues.apache.org/jira/browse/DRILL-2618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15015005#comment-15015005
 ] 

ASF GitHub Bot commented on DRILL-2618:
---------------------------------------

Github user hnfgns commented on a diff in the pull request:

    https://github.com/apache/drill/pull/270#discussion_r45427442
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSelection.java 
---
    @@ -19,82 +19,72 @@
     
     import java.io.IOException;
     import java.net.URI;
    -import java.util.Collections;
     import java.util.List;
    -import java.util.concurrent.TimeUnit;
    -
    -import com.google.common.base.Stopwatch;
    -import org.apache.commons.lang3.ArrayUtils;
    -import org.apache.commons.lang3.StringUtils;
    -import 
org.apache.drill.exec.store.parquet.Metadata.ParquetTableMetadata_v1;
    -import org.apache.hadoop.fs.FileStatus;
    -import org.apache.hadoop.fs.Path;
    +import javax.annotation.Nullable;
     
     import com.fasterxml.jackson.annotation.JsonIgnore;
    +import com.google.common.base.Preconditions;
    +import com.google.common.base.Predicate;
    +import com.google.common.base.Strings;
    +import com.google.common.collect.Iterables;
     import com.google.common.collect.Lists;
    +import org.apache.hadoop.fs.FileStatus;
    +import org.apache.hadoop.fs.Path;
     
     /**
    - * Jackson serializable description of a file selection. Maintains an 
internal set of file statuses. However, also
    - * serializes out as a list of Strings. All accessing methods first 
regenerate the FileStatus objects if they are not
    - * available.  This allows internal movement of FileStatus and the ability 
to serialize if need be.
    + * Jackson serializable description of a file selection.
      */
     public class FileSelection {
       static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(FileSelection.class);
     
       @JsonIgnore
    -  private List<FileStatus> statuses;
    +  public List<FileStatus> statuses;
    --- End diff --
    
    good point. done.


> BasicFormatMatcher calls getFirstPath(...) without checking # of paths is not 
> zero
> ----------------------------------------------------------------------------------
>
>                 Key: DRILL-2618
>                 URL: https://issues.apache.org/jira/browse/DRILL-2618
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Storage - Other
>            Reporter: Daniel Barclay (Drill)
>            Assignee: Deneche A. Hakim
>             Fix For: 1.4.0
>
>
> {{BasicFormatMatcher.isReadable(...)}} calls {{getFirstPath(...)}} without 
> checking that there is at least one path.  This can cause an 
> IndexOutOfBoundsException.
> To reproduce, create an empty directory {{/tmp/CaseInsensitiveColumnNames}} 
> and run 
> {{exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to