You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by jinfengni <gi...@git.apache.org> on 2016/12/23 22:40:32 UTC

[GitHub] drill pull request #705: DRILL-5159: Make sure Drill's ProjectMergeRule oper...

GitHub user jinfengni opened a pull request:

    https://github.com/apache/drill/pull/705

    DRILL-5159: Make sure Drill's ProjectMergeRule operate on RelNodes wi\u2026

    \u2026th same convention trait.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jinfengni/incubator-drill DRILL-5159

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/drill/pull/705.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #705
    
----
commit 02af67c6223689e952cbe4775ccc6dec28269ada
Author: Jinfeng Ni <jn...@apache.org>
Date:   2016-12-22T02:00:46Z

    DRILL-5159: Make sure Drill's ProjectMergeRule operate on RelNodes with same convention trait.

----


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

[GitHub] drill pull request #705: DRILL-5159: Make sure Drill's ProjectMergeRule oper...

Posted by amansinha100 <gi...@git.apache.org>.
Github user amansinha100 commented on a diff in the pull request:

    https://github.com/apache/drill/pull/705#discussion_r94437725
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeProjectRule.java ---
    @@ -48,6 +50,12 @@ public boolean matches(RelOptRuleCall call) {
         Project topProject = call.rel(0);
         Project bottomProject = call.rel(1);
     
    +    // Make sure both projects be LogicalProject.
    +    if (topProject.getTraitSet().getTrait(ConventionTraitDef.INSTANCE) != Convention.NONE ||
    --- End diff --
    
    At first glance, it is non-intuitive that a Drill specific MergeProjectRule returns False if a DRILL_LOGICAL convention is encountered.  However, currently, this rule only checks for the complex expression (e.g convert_to_json), so your change is fine in the context of the current rule.  
    In future, would we consider allowing merging 2 DrillProjectRels ? (I think yes). 


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

[GitHub] drill issue #705: DRILL-5159: Make sure Drill's ProjectMergeRule operate on ...

Posted by amansinha100 <gi...@git.apache.org>.
Github user amansinha100 commented on the issue:

    https://github.com/apache/drill/pull/705
  
    +1


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

[GitHub] drill pull request #705: DRILL-5159: Make sure Drill's ProjectMergeRule oper...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/drill/pull/705


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

[GitHub] drill pull request #705: DRILL-5159: Make sure Drill's ProjectMergeRule oper...

Posted by jinfengni <gi...@git.apache.org>.
Github user jinfengni commented on a diff in the pull request:

    https://github.com/apache/drill/pull/705#discussion_r94443444
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeProjectRule.java ---
    @@ -48,6 +50,12 @@ public boolean matches(RelOptRuleCall call) {
         Project topProject = call.rel(0);
         Project bottomProject = call.rel(1);
     
    +    // Make sure both projects be LogicalProject.
    +    if (topProject.getTraitSet().getTrait(ConventionTraitDef.INSTANCE) != Convention.NONE ||
    --- End diff --
    
    You are right that the current Drill specific MergeProjectRule extends from Calcite's version and the only difference is to check complex output expression. Therefore, it make senses the currently Drill MergeProjectRule operates on Calcite logical convention only. 
    
    Yes, in the future, we would consider allowing merging 2 DrillProjectRels. That should be another instance of rule, which operates on DRILL_LOGICAL convention only.  


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