wuchong commented on a change in pull request #11490: [FLINK-15579][table-planner-blink] UpsertStreamTableSink should work on batch mode URL: https://github.com/apache/flink/pull/11490#discussion_r396488243
########## File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/utils/UpdatingPlanChecker.scala ########## @@ -68,4 +70,18 @@ object UpdatingPlanChecker { } } } + + def getUniqueKeyForUpsertSink( + sinkNode: Sink, + planner: PlannerBase, + sink: UpsertStreamTableSink[_]): Option[Array[String]] = { + // extract unique key fields + // Now we pick shortest one to sink + // TODO UpsertStreamTableSink setKeyFields interface should be Array[Array[String]] + val sinkFieldNames = sink.getTableSchema.getFieldNames + UpdatingPlanChecker.getUniqueKeyFields(sinkNode.getInput, planner, sinkFieldNames) match { Review comment: `UpdatingPlanChecker.getUniqueKeyFields` is only used by this method. Maybe you can merge it into this method. ---------------------------------------------------------------- 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