JingsongLi commented on a change in pull request #10700: [FLINK-15383][table 
sql / planner & legacy planner] Using sink schema field name instead of query 
schema field name for UpsertStreamTableSink.
URL: https://github.com/apache/flink/pull/10700#discussion_r361933376
 
 

 ##########
 File path: 
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/util/UpdatingPlanChecker.scala
 ##########
 @@ -37,8 +37,12 @@ object UpdatingPlanChecker {
   }
 
   /** Extracts the unique keys of the table produced by the plan. */
-  def getUniqueKeyFields(plan: RelNode): Option[Array[String]] = {
-    getUniqueKeyGroups(plan).map(_.map(_._1).toArray)
+  def getUniqueKeyFields(plan: RelNode, sinkFieldNames: List[String]): 
Option[Array[String]] = {
+    val relFieldNames = plan.getRowType.getFieldNames
+    getUniqueKeyGroups(plan).map(
+      _.map(
+        r => sinkFieldNames.get(relFieldNames.indexOf(r._1))
 
 Review comment:
   Don't need new line.

----------------------------------------------------------------
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

Reply via email to