wuchong commented on a change in pull request #9195:
[FLINK-13289][table-planner-blink] Blink-planner should setKeyFields to upsert
table sink
URL: https://github.com/apache/flink/pull/9195#discussion_r307338916
##########
File path:
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/physical/stream/StreamExecSink.scala
##########
@@ -97,6 +97,26 @@ class StreamExecSink[T](
// check for append only table
val isAppendOnlyTable = UpdatingPlanChecker.isAppendOnly(this)
upsertSink.setIsAppendOnly(isAppendOnlyTable)
+
+ // extract unique key fields
+ // Now we pick shortest one to sink
+ // TODO UpsertStreamTableSink setKeyFields interface should be
Array[Array[String]]
+ val tableKeys = {
+ UpdatingPlanChecker.getUniqueKeyFields(getInput, planner) match {
+ case Some(keys) => keys.sortBy(_.length).headOption
Review comment:
Should we return the longest instead of the shortest one? So that it can be
the same with flink planner when window start and window end are both selected.
----------------------------------------------------------------
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