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_r407135562
########## File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/trait/UpdateKindTraitDef.scala ########## @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.table.planner.plan.`trait` + +import org.apache.calcite.plan.{RelOptPlanner, RelTraitDef} +import org.apache.calcite.rel.RelNode + +class UpdateKindTraitDef extends RelTraitDef[UpdateKindTrait] { + + override def getTraitClass: Class[UpdateKindTrait] = classOf[UpdateKindTrait] + + override def getSimpleName: String = this.getClass.getSimpleName + + override def convert( + planner: RelOptPlanner, + rel: RelNode, + toTrait: UpdateKindTrait, + allowInfiniteCostConverters: Boolean): RelNode = { + rel.copy(rel.getTraitSet.plus(toTrait), rel.getInputs) + } + + override def canConvert( + planner: RelOptPlanner, + fromTrait: UpdateKindTrait, + toTrait: UpdateKindTrait): Boolean = true Review comment: we should throw exception here which means `UpdateKindTraitDef ` 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: us...@infra.apache.org With regards, Apache Git Services