xuyangzhong opened a new pull request, #27838:
URL: https://github.com/apache/flink/pull/27838
## What is the purpose of the change
When deciding whether a sink can accept ONLY_UPDATE_AFTER (i.e., drop
UPDATE_BEFORE), the current logic requires the input's upsert key to exactly
match the sink's primary key. This is overly conservative when immutable
columns are present.I f the extra columns in the sink PK (beyond the upsert
key) are all immutable, then the sink PK is effectively a valid upsert key and
UPDATE_BEFORE can still be safely dropped.
## Brief change log
- In inferSinkRequiredTraits, query the input's immutable columns via
FlinkRelMetadataQuery.getImmutableColumns
- Relax the upsert-key-vs-sink-PK check: instead of requiring exact
equality, allow the sink PK to match if it contains a upsert key and all
remaining columns are immutable
- Add corresponding test cases in ChangelogModeInferenceTest
## Verifying this change
New tests are added to verify this pr.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented?
--
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]