[ 
https://issues.apache.org/jira/browse/FLINK-40725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18117688#comment-18117688
 ] 

Sergey Nuyanzin commented on FLINK-40725:
-----------------------------------------

Merged as 
[95816699623472e27797cc8901b4cf8c414e6d99|https://github.com/apache/flink-connector-jdbc/commit/95816699623472e27797cc8901b4cf8c414e6d99]

> 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
>            Priority: Major
>              Labels: pull-request-available
>
> 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