Class DrillMergeProjectRule

java.lang.Object
org.apache.calcite.plan.RelOptRule
org.apache.drill.exec.planner.logical.DrillMergeProjectRule

public class DrillMergeProjectRule extends org.apache.calcite.plan.RelOptRule
Rule for merging two projects provided the projects aren't projecting identical sets of input references. NOTE: This rules does not extend the Calcite ProjectMergeRule because of CALCITE-2223. Once, fixed this rule be changed accordingly. Please see DRILL-6501.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.calcite.plan.RelOptRule

    org.apache.calcite.plan.RelOptRule.ConverterRelOptRuleOperand
  • Field Summary

    Fields inherited from class org.apache.calcite.plan.RelOptRule

    description, operands, relBuilderFactory
  • Method Summary

    Modifier and Type
    Method
    Description
    getInstance(boolean force, org.apache.calcite.rel.core.RelFactories.ProjectFactory pFactory, FunctionImplementationRegistry functionRegistry)
     
    boolean
    matches(org.apache.calcite.plan.RelOptRuleCall call)
     
    void
    onMatch(org.apache.calcite.plan.RelOptRuleCall call)
     
    static org.apache.calcite.rel.core.Project
    replace(org.apache.calcite.rel.core.Project topProject, org.apache.calcite.rel.core.Project bottomProject)
    The purpose of the replace() method is to allow the caller to replace a 'top' and 'bottom' project with a single merged project with the assumption that caller knows exactly the semantics/correctness of merging the two projects.
    static List<org.apache.calcite.rex.RexNode>
    simplifyCast(List<org.apache.calcite.rex.RexNode> projectExprs)
     

    Methods inherited from class org.apache.calcite.plan.RelOptRule

    any, convert, convert, convertList, convertOperand, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, none, operand, operand, operand, operand, operand, operandJ, operandJ, some, toString, unordered

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • getInstance

      public static DrillMergeProjectRule getInstance(boolean force, org.apache.calcite.rel.core.RelFactories.ProjectFactory pFactory, FunctionImplementationRegistry functionRegistry)
    • matches

      public boolean matches(org.apache.calcite.plan.RelOptRuleCall call)
      Overrides:
      matches in class org.apache.calcite.plan.RelOptRule
    • onMatch

      public void onMatch(org.apache.calcite.plan.RelOptRuleCall call)
      Specified by:
      onMatch in class org.apache.calcite.plan.RelOptRule
    • simplifyCast

      public static List<org.apache.calcite.rex.RexNode> simplifyCast(List<org.apache.calcite.rex.RexNode> projectExprs)
    • replace

      public static org.apache.calcite.rel.core.Project replace(org.apache.calcite.rel.core.Project topProject, org.apache.calcite.rel.core.Project bottomProject)
      The purpose of the replace() method is to allow the caller to replace a 'top' and 'bottom' project with a single merged project with the assumption that caller knows exactly the semantics/correctness of merging the two projects. This is not applying the full fledged DrillMergeProjectRule.
      Parameters:
      topProject -
      bottomProject -
      Returns:
      new project after replacement