fresh-borzoni commented on code in PR #29653:
URL: https://github.com/apache/flink/pull/29653#discussion_r4416931834
##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/nodes/physical/stream/StreamPhysicalSink.scala:
##########
@@ -147,8 +147,9 @@ class StreamPhysicalSink(
val primaryKeys =
contextResolvedTable.getResolvedSchema.getPrimaryKeyIndexes
val pks = ImmutableBitSet.of(primaryKeys: _*)
val fmq = FlinkRelMetadataQuery.reuseOrCreate(getCluster.getMetadataQuery)
- val changeLogUpsertKeys = fmq.getUpsertKeys(getInput)
- changeLogUpsertKeys != null &&
changeLogUpsertKeys.asScala.exists(pks.contains)
+ // upsert keys within the pk, treating equi-join-equivalent columns as
interchangeable
+ val changeLogUpsertKeys =
UpsertKeyEquivalenceUtil.upsertKeysWithin(getInput, pks, fmq)
Review Comment:
I'll wait for maintainers for this to agree on the shape, but good point 👍
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]