我们可以使用 Flink kafka Upsert 连接器连接 to/from 一个 Kafka 压缩主题吗?

Can we connect to/from a Kafka compacted topic with the Flink kafka Upsert connector?

感觉很明显,但我还是要问,因为我在文档中找不到明确的确认:

Flink 1.12 中可用的 Flink Table API upsert kafka connector 的语义与 Kafka 压缩主题的语义非常匹配:将流解释为更新日志并使用 NULL 值作为逻辑删除来标记删除。

所以我的假设是可以使用它来消费和生产紧凑的主题,它可能正是为此而制作的,尽管它应该工作得很好假设其内容确实是一个变更日志,那么对于一个非压缩的主题来说很好。但我很惊讶没有在文档的那部分找到任何对压缩主题的引用。

有人可以证实或证实这个假设吗?

是的,它是为压缩主题而设计的。根据FLIP-149:

Generally speaking, the underlying topic of the upsert-kafka source must be compacted. Besides, the underlying topic must have all the data with the same key in the same partition, otherwise, the result will be wrong.