godfreyhe commented on a change in pull request #11674:
[FLINK-16887][table-planner-blink] Refactor retraction rules to support
inferring ChangelogMode
URL: https://github.com/apache/flink/pull/11674#discussion_r407135526
##########
File path:
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/trait/ModifyKindSetTraitDef.scala
##########
@@ -21,61 +21,30 @@ package org.apache.flink.table.planner.plan.`trait`
import org.apache.calcite.plan.{RelOptPlanner, RelTraitDef}
import org.apache.calcite.rel.RelNode
-/**
- * Definition of the [[UpdateAsRetractionTrait]].
- */
-class UpdateAsRetractionTraitDef extends RelTraitDef[UpdateAsRetractionTrait] {
- override def convert(
- planner: RelOptPlanner,
- rel: RelNode,
- toTrait: UpdateAsRetractionTrait,
- allowInfiniteCostConverters: Boolean): RelNode = {
+class ModifyKindSetTraitDef extends RelTraitDef[ModifyKindSetTrait] {
- rel.copy(rel.getTraitSet.plus(toTrait), rel.getInputs)
- }
-
- override def canConvert(
- planner: RelOptPlanner,
- fromTrait: UpdateAsRetractionTrait,
- toTrait: UpdateAsRetractionTrait): Boolean = true
-
- override def getTraitClass: Class[UpdateAsRetractionTrait] =
classOf[UpdateAsRetractionTrait]
+ override def getTraitClass: Class[ModifyKindSetTrait] =
classOf[ModifyKindSetTrait]
override def getSimpleName: String = this.getClass.getSimpleName
- override def getDefault: UpdateAsRetractionTrait =
UpdateAsRetractionTrait.DEFAULT
-}
-
-object UpdateAsRetractionTraitDef {
- val INSTANCE = new UpdateAsRetractionTraitDef
-}
-
-/**
- * Definition of the [[AccModeTrait]].
- */
-class AccModeTraitDef extends RelTraitDef[AccModeTrait] {
-
override def convert(
planner: RelOptPlanner,
rel: RelNode,
- toTrait: AccModeTrait,
+ toTrait: ModifyKindSetTrait,
allowInfiniteCostConverters: Boolean): RelNode = {
-
rel.copy(rel.getTraitSet.plus(toTrait), rel.getInputs)
}
override def canConvert(
planner: RelOptPlanner,
- fromTrait: AccModeTrait,
- toTrait: AccModeTrait): Boolean = true
+ fromTrait: ModifyKindSetTrait,
+ toTrait: ModifyKindSetTrait): Boolean = true
Review comment:
we should throw exception here which means `ModifyKindSetTraitDef` does not
support volcano planner now
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services