Ilya Sterin
08/30/2023, 6:42 PMinsert into upsert_result select * from topic_a;
It will publish the messages to the upsert_result. If a record that has already been streamed, changes in topic_a (topic a can be another upsert topic or a cdc connector), it will just add a message to the upsert_results topic (no retraction). Since it's an update.
Now, when a query uses a left join, this behavior is different...
insert into upsert_result select ... from topic_a left join topic_b on topic_a.b_id = topic_b.id
Then, if initially the right hand side isn't available, it'll publish a message with null values for the right hand side (as expected), but once that data is available, it will first issue a retraction (null record) and then publish a new message with all the values.
This seems weird to me. Why would it behave in one way (real upsert) when a single table changes, but perform retract/insert on outer joins?
CC: @Giannis PolyzosMartijn Visser
08/30/2023, 7:34 PMMartijn Visser
08/30/2023, 7:35 PMIlya Sterin
08/30/2023, 9:29 PMIlya Sterin
08/30/2023, 9:33 PMIlya Sterin
08/30/2023, 9:34 PMIlya Sterin
08/30/2023, 9:34 PMMartijn Visser
08/31/2023, 6:59 AMGiannis Polyzos
08/31/2023, 8:12 AMIn an unbounded stream with a join, you never know if there's anything coming in from your sources in the future that could impact an earlier made decision.
now combine that with the downstream system like kafka versus a database with strong upsert support, different operations and downstream sinks need different ways for handling things.Ilya Sterin
08/31/2023, 1:42 PMIlya Sterin
08/31/2023, 1:42 PMIlya Sterin
08/31/2023, 1:43 PMGiannis Polyzos
08/31/2023, 3:56 PM