spuru9 opened a new pull request, #232:
URL: https://github.com/apache/flink-connector-jdbc/pull/232
## What is the purpose of the change
Flink 2.3.0 (FLIP-558, FLINK-38926) tightened the planner: a changelog query
whose upsert key differs from the sink primary key is now rejected unless the
`INSERT` declares an `ON CONFLICT` clause.
`JdbcDynamicTableSinkITCase.testReadingFromChangelogSource` — the shared base
test inherited by every database module's sink ITCase — therefore fails on
Flink 2.3.0 with a `ValidationException`, while passing on 2.1.x/2.2.x. See
FLINK-40725.
This makes the test compatible across the supported Flink range and adds
Flink 2.3.0 to the PR CI matrix so the path is actually exercised.
## Brief change log
- `JdbcDynamicTableSinkITCase.testReadingFromChangelogSource`: append `ON
CONFLICT DO DEDUPLICATE` to the `INSERT` only when running against Flink >=
2.3.0. `DO DEDUPLICATE` keeps the latest record per key, matching the prior
upsert semantics.
- Version detection uses `EnvironmentInformation.getVersion()` (leading
`major.minor`), which compiles against every supported Flink version — the
`FlinkVersion` enum constants for 2.2/2.3 do not exist in the connector's
`flink.version=2.0.0` baseline, so they cannot be referenced.
- Add `2.3.0` to the `push_pr.yml` `flink` matrix so this fix is exercised
in CI.
## Verifying this change
This change is already covered by existing tests.
`DerbyDynamicTableSinkITCase#testReadingFromChangelogSource` (the core,
Docker-free realization of the shared base test) was run locally and passes on
Flink `2.1.3`, `2.2.1`, and `2.3.0`; the default `flink.version=2.0.0` build
still compiles. The `2.3.0` job added to `push_pr.yml` exercises the fixed path
in CI.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency, including
`flink.version` or a database driver version): no
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)` or `@Experimental`, or are the Table options or the JDBC
dialect SPI changed: no
- Checkpointed state, its serializers, or exactly-once delivery: no
- The per-record code paths: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (Claude Code)
Generated-by: Claude Code (Claude Opus 4.8)
--
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]