Class PushFilterIntoSourceScanRuleBase
java.lang.Object
org.apache.calcite.plan.RelOptRule
org.apache.flink.table.planner.plan.rules.logical.PushFilterIntoSourceScanRuleBase
- Direct Known Subclasses:
PushFilterInCalcIntoTableSourceScanRule,PushFilterIntoTableSourceScanRule
public abstract class PushFilterIntoSourceScanRuleBase
extends org.apache.calcite.plan.RelOptRule
Base class for rules that push down filters into table scan.
-
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 -
Constructor Summary
ConstructorsConstructorDescriptionPushFilterIntoSourceScanRuleBase(org.apache.calcite.plan.RelOptRuleOperand operand, String description) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanPushdownFilter(TableSourceTable tableSourceTable) Determines wether we can pushdown the filter into the source. we can not push filter twice, make sure FilterPushDownSpec has not been assigned as a capability.protected List<org.apache.calcite.rex.RexNode>convertExpressionToRexNode(List<org.apache.flink.table.expressions.ResolvedExpression> expressions, RelBuilder relBuilder) protected org.apache.calcite.rex.RexNodecreateRemainingCondition(RelBuilder relBuilder, List<org.apache.flink.table.expressions.ResolvedExpression> expressions, org.apache.calcite.rex.RexNode[] unconvertedPredicates) protected scala.Tuple2<org.apache.flink.table.connector.source.abilities.SupportsFilterPushDown.Result,TableSourceTable> resolveFiltersAndCreateTableSourceTable(org.apache.calcite.rex.RexNode[] convertiblePredicates, TableSourceTable oldTableSourceTable, org.apache.calcite.rel.core.TableScan scan, RelBuilder relBuilder) Resolves filters using the underlying sourcesSupportsFilterPushDownand creates a newTableSourceTablewith the supplied predicates.Methods inherited from class org.apache.calcite.plan.RelOptRule
any, 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
-
Constructor Details
-
PushFilterIntoSourceScanRuleBase
public PushFilterIntoSourceScanRuleBase(org.apache.calcite.plan.RelOptRuleOperand operand, String description)
-
-
Method Details
-
convertExpressionToRexNode
protected List<org.apache.calcite.rex.RexNode> convertExpressionToRexNode(List<org.apache.flink.table.expressions.ResolvedExpression> expressions, RelBuilder relBuilder) -
createRemainingCondition
protected org.apache.calcite.rex.RexNode createRemainingCondition(RelBuilder relBuilder, List<org.apache.flink.table.expressions.ResolvedExpression> expressions, org.apache.calcite.rex.RexNode[] unconvertedPredicates) -
resolveFiltersAndCreateTableSourceTable
protected scala.Tuple2<org.apache.flink.table.connector.source.abilities.SupportsFilterPushDown.Result,TableSourceTable> resolveFiltersAndCreateTableSourceTable(org.apache.calcite.rex.RexNode[] convertiblePredicates, TableSourceTable oldTableSourceTable, org.apache.calcite.rel.core.TableScan scan, RelBuilder relBuilder) Resolves filters using the underlying sourcesSupportsFilterPushDownand creates a newTableSourceTablewith the supplied predicates.- Parameters:
convertiblePredicates- Predicates to resolveoldTableSourceTable- TableSourceTable to copyscan- Underlying table scan to push torelBuilder- Builder to push the scan to- Returns:
- A tuple, constituting of the resolved filters and the newly created
TableSourceTable
-
canPushdownFilter
protected boolean canPushdownFilter(TableSourceTable tableSourceTable) Determines wether we can pushdown the filter into the source. we can not push filter twice, make sure FilterPushDownSpec has not been assigned as a capability.- Parameters:
tableSourceTable- Table scan to attempt to push into- Returns:
- Whether we can push or not
-