drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinfengni <...@git.apache.org>
Subject [GitHub] drill pull request: DRILL-4474: Ensure that ConvertCountToDirectSc...
Date Wed, 09 Mar 2016 00:49:42 GMT
Github user jinfengni commented on a diff in the pull request:

    https://github.com/apache/drill/pull/416#discussion_r55455931
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ConvertCountToDirectScan.java
---
    @@ -117,6 +117,24 @@ public void onMatch(RelOptRuleCall call) {
           } else if (aggCall.getArgList().size() == 1) {
           // count(columnName) ==> Agg ( Scan )) ==> columnValueCount
             int index = aggCall.getArgList().get(0);
    +
    +        if (proj != null) {
    +          // project in the middle of Agg and Scan : Only when input of AggCall is a
RexInputRef in Project, we find the index of Scan's field.
    +          // For instance,
    +          // Agg - count($0)
    +          //  \
    +          //  Proj - Exp={$1}
    +          //    \
    +          //   Scan (col1, col2).
    +          // return count of "col2" in Scan's metadata, if found.
    +
    +          if (proj.getProjects().get(index) instanceof RexInputRef) {
    +            index = ((RexInputRef) proj.getProjects().get(index)).getIndex();
    --- End diff --
    
    Make sense. Let me add more unit test in the patch. 


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