Class FilterJoinExcludePushToChildRule<C extends org.apache.calcite.rel.rules.FilterJoinRule.Config>
java.lang.Object
org.apache.calcite.plan.RelOptRule
org.apache.calcite.plan.RelRule<C>
org.apache.calcite.rel.rules.FilterJoinRule<C>
org.apache.druid.sql.calcite.rule.FilterJoinExcludePushToChildRule<C>
- All Implemented Interfaces:
org.apache.calcite.rel.rules.TransformationRule
- Direct Known Subclasses:
FilterJoinExcludePushToChildRule.FilterIntoJoinExcludePushToChildRule
public abstract class FilterJoinExcludePushToChildRule<C extends org.apache.calcite.rel.rules.FilterJoinRule.Config>
extends org.apache.calcite.rel.rules.FilterJoinRule<C>
This class is a copy (with modification) of
FilterJoinRule. Specifically, this class contains a
subset of code from FilterJoinRule for the codepath involving
CoreRules.FILTER_INTO_JOIN
Everything has been keep as-is from FilterJoinRule except for :
1. the modification of classifyFilters(List, JoinRelType, boolean, List) method called in the
perform(RelOptRuleCall, Filter, Join) method of this class.
2. removing redundant 'IS NOT NULL' filters from inner join filter condition
The classifyFilters(List, JoinRelType, boolean, List) method is based of RelOptUtil.classifyFilters(org.apache.calcite.rel.RelNode, java.util.List<org.apache.calcite.rex.RexNode>, boolean, boolean, boolean, java.util.List<org.apache.calcite.rex.RexNode>, java.util.List<org.apache.calcite.rex.RexNode>, java.util.List<org.apache.calcite.rex.RexNode>).
The difference is that the modfied method use in thsi class will not not push filters to the children.
Hence, filters will either stay where they are or are pushed to the join (if they originated from above the join).
The modification of classifyFilters(List, JoinRelType, boolean, List) is needed due to the bug described in
https://github.com/apache/druid/pull/9773. This class and it's modification can be removed, switching back to the
default Rule provided in Calcite's FilterJoinRule when https://github.com/apache/druid/issues/9843 is resolved.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRule that tries to push filter expressions into a join condition.Nested classes/interfaces inherited from class org.apache.calcite.rel.rules.FilterJoinRule
org.apache.calcite.rel.rules.FilterJoinRule.Config, org.apache.calcite.rel.rules.FilterJoinRule.FilterIntoJoinRule, org.apache.calcite.rel.rules.FilterJoinRule.JoinConditionPushRule, org.apache.calcite.rel.rules.FilterJoinRule.PredicateNested classes/interfaces inherited from class org.apache.calcite.plan.RelRule
org.apache.calcite.plan.RelRule.Done, org.apache.calcite.plan.RelRule.MatchHandler<R extends org.apache.calcite.plan.RelOptRule>, org.apache.calcite.plan.RelRule.OperandBuilder, org.apache.calcite.plan.RelRule.OperandDetailBuilder<R extends org.apache.calcite.rel.RelNode>, org.apache.calcite.plan.RelRule.OperandTransformNested classes/interfaces inherited from class org.apache.calcite.plan.RelOptRule
org.apache.calcite.plan.RelOptRule.ConverterRelOptRuleOperand -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.calcite.rel.rules.FilterJoinRule<org.apache.calcite.rel.rules.FilterJoinRule.FilterIntoJoinRule.FilterIntoJoinRuleConfig>Fields inherited from class org.apache.calcite.rel.rules.FilterJoinRule
TRUE_PREDICATEFields inherited from class org.apache.calcite.plan.RelRule
configFields inherited from class org.apache.calcite.plan.RelOptRule
description, operands, relBuilderFactory -
Method Summary
Modifier and TypeMethodDescriptionprotected voidperform(org.apache.calcite.plan.RelOptRuleCall call, org.apache.calcite.rel.core.Filter filter, org.apache.calcite.rel.core.Join join) Copied fromFilterJoinRule.perform(org.apache.calcite.plan.RelOptRuleCall, org.apache.calcite.rel.core.Filter, org.apache.calcite.rel.core.Join)The difference is that this method will not not push filters to the children in classifyFiltersMethods inherited from class org.apache.calcite.rel.rules.FilterJoinRule
inferJoinEqualConditions, validateJoinFiltersMethods inherited from class org.apache.calcite.plan.RelOptRule
any, convert, convert, convert, convert, convertList, convertOperand, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, onMatch, operand, operand, operand, operand, operand, operandJ, operandJ, some, toString, unordered
-
Field Details
-
FILTER_ON_JOIN_EXCLUDE_PUSH_TO_CHILD
public static final org.apache.calcite.rel.rules.FilterJoinRule<org.apache.calcite.rel.rules.FilterJoinRule.FilterIntoJoinRule.FilterIntoJoinRuleConfig> FILTER_ON_JOIN_EXCLUDE_PUSH_TO_CHILD
-
-
Method Details
-
perform
protected void perform(org.apache.calcite.plan.RelOptRuleCall call, org.apache.calcite.rel.core.Filter filter, org.apache.calcite.rel.core.Join join) Copied fromFilterJoinRule.perform(org.apache.calcite.plan.RelOptRuleCall, org.apache.calcite.rel.core.Filter, org.apache.calcite.rel.core.Join)The difference is that this method will not not push filters to the children in classifyFilters- Overrides:
performin classorg.apache.calcite.rel.rules.FilterJoinRule<C extends org.apache.calcite.rel.rules.FilterJoinRule.Config>
-