Search code examples
apache-flinkflink-streamingflink-sql

Is RETRACT stream necessary in Flink?


When using RETRACT stream in Flink, update message is finished by two stages, while when using UPSERT stream, it's finished by one stage, which is more efficient.

However, UPSERT stream is not allowed when converting a Dynamic table to a DataStream according to this page, why such a limitation exists? What kinds of problems will be met when we totally replace RETRACT with UPSERT in Flink's design?


Solution

  • What kinds of problems will be met when we totally replace RETRACT with UPSERT in Flink's design?

    As the page you linked to mentions, upsert streams require a primary key. Getting rid of retract streams as a concept, consequently, would break all scenarios where you do not have such a key (at all or just not defined).