public abstract class DynamicPartitionPruningRule
extends org.apache.calcite.plan.RelRule<org.apache.calcite.plan.RelRule.Config>
BatchPhysicalTableSourceScan
to a BatchPhysicalDynamicFilteringTableSourceScan
whose source is a partition source. The OptimizerConfigOptions.TABLE_OPTIMIZER_DYNAMIC_FILTERING_ENABLED
need to be true.
Suppose we have the original physical plan:
LogicalProject(...)
HashJoin(joinType=[InnerJoin], where=[=(fact_partition_key, dim_key)], select=[xxx])
* :- TableSourceScan(table=[[fact]], fields=[xxx, fact_partition_key],) # Is a partition table.
* +- Exchange(distribution=[broadcast])
* +- Calc(select=[xxx], where=[<(xxx, xxx)]) # Need have an arbitrary filter condition.
* +- TableSourceScan(table=[[dim, filter=[]]], fields=[xxx, dim_key])
This physical plan will be rewritten to:
HashJoin(joinType=[InnerJoin], where=[=(fact_partition_key, dim_key)], select=[xxx])
:- DynamicFilteringTableSourceScan(table=[[fact]], fields=[xxx, fact_partition_key]) # Is a partition table.
: +- DynamicFilteringDataCollector(fields=[dim_key])
: +- Calc(select=[xxx], where=[<(xxx, xxx)])
: +- TableSourceScan(table=[[dim, filter=[]]], fields=[xxx, dim_key])
+- Exchange(distribution=[broadcast])
+- Calc(select=[xxx], where=[<(xxx, xxx)]) # Need have an arbitrary filter condition.
+- TableSourceScan(table=[[dim, filter=[]]], fields=[xxx, dim_key])
Modifier and Type | Class and Description |
---|---|
protected static class |
DynamicPartitionPruningRule.DynamicPartitionPruningFactInLeftRule
Simple dynamic filtering pattern with fact side in join left.
|
protected static class |
DynamicPartitionPruningRule.DynamicPartitionPruningFactInLeftWithCalcRule
Dynamic filtering pattern with calc node in fact side while fact side in join left.
|
protected static class |
DynamicPartitionPruningRule.DynamicPartitionPruningFactInLeftWithExchangeAndCalcRule
Dynamic filtering pattern with exchange node and calc node in fact side while fact side in
join left.
|
protected static class |
DynamicPartitionPruningRule.DynamicPartitionPruningFactInLeftWithExchangeRule
Dynamic filtering pattern with exchange node in fact side while fact side in join left.
|
protected static class |
DynamicPartitionPruningRule.DynamicPartitionPruningFactInRightRule
Simple dynamic filtering pattern with fact side in join right.
|
protected static class |
DynamicPartitionPruningRule.DynamicPartitionPruningFactInRightWithCalcRule
Dynamic filtering pattern with calc node in fact side while fact side in join right.
|
protected static class |
DynamicPartitionPruningRule.DynamicPartitionPruningFactInRightWithExchangeAndCalcRule
Dynamic filtering pattern with exchange node and calc node in fact side while fact side in
join right.
|
protected static class |
DynamicPartitionPruningRule.DynamicPartitionPruningFactInRightWithExchangeRule
Dynamic filtering pattern with exchange node in fact side while fact side in join right.
|
org.apache.calcite.plan.RelRule.Config, 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.OperandTransform
Modifier and Type | Field and Description |
---|---|
static org.apache.calcite.tools.RuleSet |
DYNAMIC_PARTITION_PRUNING_RULES |
Modifier | Constructor and Description |
---|---|
protected |
DynamicPartitionPruningRule(org.apache.calcite.plan.RelRule.Config config) |
Modifier and Type | Method and Description |
---|---|
protected org.apache.flink.table.planner.plan.nodes.physical.batch.BatchPhysicalDynamicFilteringTableSourceScan |
createDynamicFilteringTableSourceScan(org.apache.flink.table.planner.plan.nodes.physical.batch.BatchPhysicalTableSourceScan factScan,
org.apache.flink.table.planner.plan.nodes.physical.batch.BatchPhysicalRel dimSide,
org.apache.flink.table.planner.plan.nodes.physical.batch.BatchPhysicalJoinBase join,
org.apache.flink.table.planner.plan.nodes.physical.batch.BatchPhysicalCalc factCalc,
boolean factInLeft) |
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
public static final org.apache.calcite.tools.RuleSet DYNAMIC_PARTITION_PRUNING_RULES
protected DynamicPartitionPruningRule(org.apache.calcite.plan.RelRule.Config config)
protected org.apache.flink.table.planner.plan.nodes.physical.batch.BatchPhysicalDynamicFilteringTableSourceScan createDynamicFilteringTableSourceScan(org.apache.flink.table.planner.plan.nodes.physical.batch.BatchPhysicalTableSourceScan factScan, org.apache.flink.table.planner.plan.nodes.physical.batch.BatchPhysicalRel dimSide, org.apache.flink.table.planner.plan.nodes.physical.batch.BatchPhysicalJoinBase join, @Nullable org.apache.flink.table.planner.plan.nodes.physical.batch.BatchPhysicalCalc factCalc, boolean factInLeft)
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.