Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-5159

ProjectMergeRule in Drill should operate on RelNodes with same convention trait.

    XMLWordPrintableJSON

Details

    Description

      Drill extended version of Calcite's ProjectMergeRule is used in a VolcanoPlanner where RelNodes with different convention could match with this rule.

      For instance, we could see this rule could be invoked when a DrillProject on top of a LogicalProject. Also, since the output RelNode is built from the default Project RelFactory, such rule execution could end up with a LogicalProject.

      DrillProject                transform          
      \                                  ===>               LogicalProject
      LogicalProject
      

      This leads to un-necessary rule execution, or in certain case could lead to an infinite loop.

      The proposed fix is to check matched RelNodes to make sure that they do have Calcite Logical convention. That way, both inputs and output of this rule would have same convention trait. This should reduce planning time, and avoid the possiblity of loop.

      Attachments

        Issue Links

          Activity

            People

              jni Jinfeng Ni
              jni Jinfeng Ni
              Rahul Kumar Challapalli Rahul Kumar Challapalli
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: