gustavodemorais opened a new pull request, #351:
URL: https://github.com/apache/flink-connector-kafka/pull/351
## What is the purpose of the change
Since FLINK-41533 the upsert-kafka source declares key-only deletes. The
sink still requires full deletes, so an upsert-kafka source feeding an
upsert-kafka sink with the same primary key gets a stateful
`ChangelogNormalize` again, although a tombstone only needs the key. This lets
the sink accept key-only deletes when it writes to a single topic and all value
columns are nullable.
- Topic list or pattern: each row picks its topic from the `topic` metadata
column, which a key-only delete does not guarantee to carry.
- NOT NULL value columns: the NOT NULL enforcer of Flink versions without
FLINK-40477 rejects deletes with NULL values. The check can be removed once the
connector's minimum Flink version contains FLINK-40477 (Flink 2.4+).
## Brief change log
- `UpsertKafkaDynamicTableFactory` decides whether the sink accepts
key-only deletes and passes it to `EncodingFormatWrapper`, next to the source's
`DecodingFormatWrapper`
## Verifying this change
-
`UpsertKafkaDynamicTableFactoryTest#testChangelogNormalizeIsRemovedForSinkAcceptingKeyOnlyDeletes`:
no `ChangelogNormalize` from an upsert-kafka source into a single-topic
upsert-kafka sink
-
`UpsertKafkaDynamicTableFactoryTest#testChangelogNormalizeIsKeptForSinkRequiringFullDeletes`:
`ChangelogNormalize` stays for a NOT NULL value column and for a topic list
- `testTableSink` / `testTableSinkWithTopicList` assert the sink's
changelog mode
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency, including
`kafka.version` or `flink.version`): no
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)` or `@Experimental`, or are the Table options or the PyFlink
wrappers changed: no
- Checkpointed state, its serializers, or exactly-once delivery (splits,
enumerator state, writer state, committables, transactions): no
- The per-record code paths (split reader, record emitter, writer,
serialization schemas; performance sensitive): no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
- If the docs changed, are both `docs/content` and `docs/content.zh`
updated? not applicable
---
##### Was generative AI tooling used to co-author this PR?
- [x] Yes (please specify the tool below)
Generated-by: Claude Code 2.1.304 (Opus 5.5)
--
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]