Martijn Visser created FLINK-40899:
--------------------------------------

             Summary: ON CONFLICT validation masks the NDU error for lookup 
joins
                 Key: FLINK-40899
                 URL: https://issues.apache.org/jira/browse/FLINK-40899
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Planner
            Reporter: Martijn Visser


For a lookup join with a non-deterministic condition {{FlinkRelMdUpsertKeys}} 
drops the right-side upsert keys, so the sink input has no upsert key. With 
table.exec.sink.require-on-conflict enabled, the default, the validation in 
{{FlinkChangelogModeInferenceProgram}} fails the query with a key mismatch 
message before the NDU visitor runs, also under TRY_RESOLVE. The suggested ON 
CONFLICT DO DEDUPLICATE adds a SinkUpsertMaterializer that never sees the 
dropped retraction, so the error goes away and the result stays wrong.

We should report the non-deterministic condition first, or mention it in the 
validation message.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to