Github user xccui commented on a diff in the pull request: https://github.com/apache/flink/pull/5025#discussion_r151613194 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala --- @@ -234,11 +234,12 @@ abstract class StreamTableEnvironment( "UpsertStreamTableSink requires that Table has a full primary keys if it is updated.") } val outputType = sink.getOutputType + val resultType = getResultType(table.getRelNode, optimizedPlan) --- End diff -- Since the `fieldNames` and `fieldTypes` in parameter `sink` are generated based on the raw RowType, https://github.com/apache/flink/blob/81dc260dc653085b9dbf098e8fd70a72d2d0828e/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/table.scala#L848 while the `resultType` here is generated from the optimized plan. I just wonder whether they'll be inconsistent.
---