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

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

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

    https://github.com/apache/drill/pull/155#discussion_r39526289
  
    --- Diff: 
common/src/main/java/org/apache/drill/common/expression/SchemaPath.java ---
    @@ -54,15 +50,16 @@ public static SchemaPath getSimplePath(String name) {
       }
     
       public static SchemaPath getCompoundPath(String... strings) {
    -    List<String> paths = Arrays.asList(strings);
    -    Collections.reverse(paths);
         NameSegment s = null;
    -    for (String p : paths) {
    -      s = new NameSegment(p, s);
    +    final int length = strings.length;
    +    // loop through strings in reverse order
    +    for (int i = 0; i < length; i++) {
    --- End diff --
    
    Fixed


> SchemaPath.getCompoundPath(String...strings) reverses it's input array
> ----------------------------------------------------------------------
>
>                 Key: DRILL-3767
>                 URL: https://issues.apache.org/jira/browse/DRILL-3767
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Codegen
>            Reporter: Deneche A. Hakim
>            Assignee: Aman Sinha
>            Priority: Minor
>             Fix For: 1.2.0
>
>
> If you pass an array of strings to {{SchemaPath.getCompoundPath()}}, the 
> input array will be reversed. This side effect is *undocumented* and has led 
> to at least one known bug DRILL-3758



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

Reply via email to