Class PushWatermarkIntoTableSourceScanRuleBase
java.lang.Object
org.apache.calcite.plan.RelOptRule
org.apache.flink.table.planner.plan.rules.logical.PushWatermarkIntoTableSourceScanRuleBase
- Direct Known Subclasses:
PushWatermarkIntoTableSourceScanAcrossCalcRule,PushWatermarkIntoTableSourceScanRule
public abstract class PushWatermarkIntoTableSourceScanRuleBase
extends org.apache.calcite.plan.RelOptRule
Base rule for interface
SupportsWatermarkPushDown and SupportsSourceWatermark. It
offers a util to push the FlinkLogicalWatermarkAssigner into the FlinkLogicalTableSourceScan.-
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
ConstructorsConstructorDescriptionPushWatermarkIntoTableSourceScanRuleBase(org.apache.calcite.plan.RelOptRuleOperand operand, String description) -
Method Summary
Modifier and TypeMethodDescriptionprotected FlinkLogicalTableSourceScangetNewScan(FlinkLogicalWatermarkAssigner watermarkAssigner, org.apache.calcite.rex.RexNode watermarkExpr, FlinkLogicalTableSourceScan scan, org.apache.flink.table.api.TableConfig tableConfig, boolean useWatermarkAssignerRowType) It uses the input watermark expression to generate theWatermarkGeneratorSupplier.protected booleansupportsWatermarkPushDown(FlinkLogicalTableSourceScan scan) 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
-
PushWatermarkIntoTableSourceScanRuleBase
public PushWatermarkIntoTableSourceScanRuleBase(org.apache.calcite.plan.RelOptRuleOperand operand, String description)
-
-
Method Details
-
getNewScan
protected FlinkLogicalTableSourceScan getNewScan(FlinkLogicalWatermarkAssigner watermarkAssigner, org.apache.calcite.rex.RexNode watermarkExpr, FlinkLogicalTableSourceScan scan, org.apache.flink.table.api.TableConfig tableConfig, boolean useWatermarkAssignerRowType) It uses the input watermark expression to generate theWatermarkGeneratorSupplier. After theWatermarkStrategyis pushed into the scan, it will build a new scan. However, whenFlinkLogicalWatermarkAssigneris the parent of theFlinkLogicalTableSourceScanit should modify the rowtime type to keep the type of plan is consistent. In other cases, it just keep the data type of the scan as same as before and leave the work when rewriting the projection.NOTES: the row type of the scan is not always as same as the watermark assigner. Because the scan will not add the rowtime column into the row when pushing the watermark assigner into the scan. In some cases, query may have computed columns defined on rowtime column. If modifying the type of the rowtime(with time attribute), it will also influence the type of the computed column. Therefore, if the watermark assigner is not the parent of the scan, set the type of the scan as before and leave the work to projection.
-
supportsWatermarkPushDown
protected boolean supportsWatermarkPushDown(FlinkLogicalTableSourceScan scan)
-