-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug Report]:Unable to produce tombstone records #516
Comments
Do you have any error while producing the message? |
No, there is no error. But it won't produce tombstone records when using a kafka upsert source: https://nightlies.apache.org/flink/flink-docs-master/docs/connectors/table/upsert-kafka/ . |
Like we discussed on kafkaflow on slack, by using a custom serializer, you can bypass this limitation by checking if the message is null before serializing the message value. This should produce a message where the message value is an empty byte[] which is the tombstone. Meanwhile, we will address this issue, by creating a pull request to fix the JsonCoreSerializer. Regarding the Kakfa upsert source, flink we won't expect a different behavior from Kafka client as they both produce a null record. |
I have tried that approach, end to end, using kafka-upsert source and iceberg table destination in AWS. It sends indeed an empty byte array, but that did not translate into a tombstone record. |
Fixing the issue with JsonCoreSerializer when producing a message with a null value it results in a tombstone record where the message value is an empty byte[].
public Task SerializeAsync(object? message, Stream output, ISerializerContext context)
{
if (message == null)
{
return Task.CompletedTask;
}
return SerializeNonNullMessageAsync(message, output);
} As an alternative, you can always use the native Kafka client to confirm that it also produces a tombstone record with an empty byte[] like KafkaFlow. |
When fixing it with the serializer, then it has to be changed for all serializers. Sending null for tombstoning should not be part of the serialization imho. great library by the way. :) |
I resolved it the same way for the ProtobufSerializer. Is there an idea to fix it in general? |
Prerequisites
Description
I am unable to produce tombstone records. It looks like the message value is sent as byte[0] instead of null.
Steps to reproduce
Expected behavior
Message value should be sent as null
Actual behavior
Message value is sent as byte[0]
KafkaFlow version
3.0.3
The text was updated successfully, but these errors were encountered: