[
https://issues.apache.org/jira/browse/FLINK-40809?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated FLINK-40809:
-----------------------------------
Labels: pull-request-available (was: )
> Regular outer join loses the null-padded row when an input record is updated
> without UPDATE_BEFORE
> --------------------------------------------------------------------------------------------------
>
> Key: FLINK-40809
> URL: https://issues.apache.org/jira/browse/FLINK-40809
> Project: Flink
> Issue Type: Sub-task
> Components: Table SQL / API
> Affects Versions: 2.3.0, 2.2.1, 1.20.5, 2.4.0
> Reporter: Gustavo de Morais
> Assignee: Gustavo de Morais
> Priority: Major
> Labels: pull-request-available
>
> When the planner does not require UPDATE_BEFORE on a join input, the input's
> unique key must contain the join key and the sink key must match the query's
> upsert key. {{StreamingJoinOperator}} can then receive an UPDATE_AFTER, or a
> repeated INSERT, that replaces a stored record with the same unique key. This
> is common with upsert sources such as Kafka upsert topics.
> The operator counts the replacement as a new association on the outer side.
> When the record is later deleted, the counter goes from 2 to 1 instead of 1
> to 0, so the null-padded row is never emitted again. The row silently
> disappears from the sink.
> Example:
> {code:java}
> -- customers: upsert source, PRIMARY KEY (id); sink PRIMARY KEY (order_id)
> INSERT INTO sink
> SELECT o.order_id, o.customer_id, c.name
> FROM orders o LEFT JOIN customers c ON o.customer_id = c.id; {code}
> # {{+I customers(7, 'Ann')}} → {{+I[o1, 7, Ann]}}
> # {{+U customers(7, 'Anna')}} → {{{}+I[o1, 7, Anna]{}}}, and {{o1}} now
> counts 2 matches instead of 1
> # {{-D customers(7)}} → {{{}-D[o1, 7, Anna]{}}}, but {{+I[o1, 7, null]}} is
> missing
--
This message was sent by Atlassian Jira
(v8.20.10#820010)