gustavodemorais commented on code in PR #351:
URL:
https://github.com/apache/flink-connector-kafka/pull/351#discussion_r4641745465
##########
flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/table/UpsertKafkaDynamicTableFactory.java:
##########
@@ -254,6 +258,35 @@ public DynamicTableSink createDynamicTableSink(Context
context) {
tableOptions.get(TRANSACTION_NAMING_STRATEGY));
}
+ private static boolean supportsKeyOnlyDeletes(
+ ReadableConfig tableOptions, ResolvedSchema schema) {
+ return writesToSingleTopic(tableOptions) &&
hasOnlyNullableValueColumns(schema);
+ }
+
+ /**
+ * A tombstone only needs the key, as long as the sink knows the target
topic. With a topic list
Review Comment:
That's a good question. A key-only delete doesn't guarantee to carry them,
so the tombstone falls back to producer time and no headers. I took a look to
understand if this is relevant and I think that's fine:
- Kafka doesn't use them: compaction only looks at the key and offset, and
drops the tombstone after delete.retention.ms.
- Upsert consumers (this connector's source, Kafka Streams tables, sink
connectors deleting by key) treat a tombstone as "key deleted" and ignore its
headers.
- The old values were wrong anyway: ChangelogNormalize copied the timestamp
and headers of the previous upsert, e.g. its trace id, onto the delete. No
headers is better than wrong ones.
The alternative is to also require full deletes when the table writes
timestamp or headers metadata, like for multiple topics. We could do that but
it just feels like it's not really an issue. Wdyt?
--
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]