dawidwys commented on code in PR #27502:
URL: https://github.com/apache/flink/pull/27502#discussion_r2759929626


##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/optimize/program/FlinkChangelogModeInferenceProgram.scala:
##########
@@ -1060,6 +1060,15 @@ class FlinkChangelogModeInferenceProgram extends 
FlinkOptimizeProgram[StreamOpti
         case UpsertMaterialize.FORCE => primaryKeys.nonEmpty && !sinkIsRetract
         case UpsertMaterialize.NONE => false
         case UpsertMaterialize.AUTO =>
+          // For NOTHING/ERROR strategies with a primary key, we always need 
materialization
+          // to handle conflicts, even for append-only input or insert-only 
sinks
+          val requiresMaterializationForConflict = primaryKeys.nonEmpty &&
+            sink.conflictStrategy != null &&

Review Comment:
   I reworked this code a bit.



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

Reply via email to