Purushottam Sinha created FLINK-40725:
-----------------------------------------

             Summary: JDBC table sink incompatible with Flink 2.3.0 ON CONFLICT 
/ upsert-key validation
                 Key: FLINK-40725
                 URL: https://issues.apache.org/jira/browse/FLINK-40725
             Project: Flink
          Issue Type: Bug
          Components: Connectors / JDBC
            Reporter: Purushottam Sinha


Flink 2.3.0 (FLIP-558, FLINK-38926) tightened the planner: a changelog query 
whose upsert key differs from the sink's primary key is now rejected unless the 
sink DDL declares an ON CONFLICT clause.

{{JdbcDynamicTableSinkITCase.testReadingFromChangelogSource}} - the shared base 
test inherited by every database module's sink ITCase - fails on Flink 2.3.0 
with:

{noformat}
org.apache.flink.table.api.ValidationException: The query has an upsert key 
that differs from the primary key of the sink table 
'default_catalog.default_database.user_sink'. Primary key: [user_id], upsert 
key: . ... Please specify an ON CONFLICT clause to define how conflicts should 
be handled: ON CONFLICT DO DEDUPLICATE, ON CONFLICT DO ERROR, or ON CONFLICT DO 
NOTHING.
{noformat}

The test streams an I,UA,UB,D changelog into a JDBC sink with a primary key. It 
passes on Flink 2.1.x/2.2.x (the validation does not exist there). Because the 
ON CONFLICT syntax is 2.3.0-only, any fix must be version-conditional, and the 
JDBC table sink likely needs to adopt/handle the new ON CONFLICT semantics. 
Scope is one logical test but it affects all database modules through 
inheritance.

Tracked separately from FLINK-40723, which intentionally leaves Flink 2.3.0 out 
of the PR CI matrix until this is resolved.



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

Reply via email to