Class DruidJoinRule

java.lang.Object
org.apache.calcite.plan.RelOptRule
org.apache.druid.sql.calcite.rule.DruidJoinRule

public class DruidJoinRule extends org.apache.calcite.plan.RelOptRule
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    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
    analyzeCondition(org.apache.calcite.rex.RexNode condition, org.apache.calcite.rel.type.RelDataType leftRowType, org.apache.calcite.rex.RexBuilder rexBuilder)
    If this condition is an AND of some combination of (1) literals; (2) equality conditions of the form (3) unsupported conditions
    boolean
    canHandleCondition(org.apache.calcite.rex.RexNode condition, org.apache.calcite.rel.type.RelDataType leftRowType, DruidRel<?> right, org.apache.calcite.rel.core.JoinRelType joinType, List<org.apache.calcite.rel.type.RelDataTypeField> systemFieldList, org.apache.calcite.rex.RexBuilder rexBuilder)
    Returns whether we can handle the join condition.
    instance(PlannerContext plannerContext)
     
    boolean
    matches(org.apache.calcite.plan.RelOptRuleCall call)
     
    void
    onMatch(org.apache.calcite.plan.RelOptRuleCall call)
     

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

    any, convert, convert, 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

    • instance

      public static DruidJoinRule instance(PlannerContext plannerContext)
    • 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
    • canHandleCondition

      public boolean canHandleCondition(org.apache.calcite.rex.RexNode condition, org.apache.calcite.rel.type.RelDataType leftRowType, DruidRel<?> right, org.apache.calcite.rel.core.JoinRelType joinType, List<org.apache.calcite.rel.type.RelDataTypeField> systemFieldList, org.apache.calcite.rex.RexBuilder rexBuilder)
      Returns whether we can handle the join condition. In case, some conditions in an AND expression are not supported, they are extracted into a post-join filter instead.
    • analyzeCondition

      public static DruidJoinRule.ConditionAnalysis analyzeCondition(org.apache.calcite.rex.RexNode condition, org.apache.calcite.rel.type.RelDataType leftRowType, org.apache.calcite.rex.RexBuilder rexBuilder)
      If this condition is an AND of some combination of (1) literals; (2) equality conditions of the form (3) unsupported conditions

      Returns empty if the join cannot be supported at all. It can return non-empty with some unsupported conditions that can be extracted into post join filter. f(LeftRel) = RightColumn, then return a DruidJoinRule.ConditionAnalysis.