Gustavo de Morais created FLINK-40858:
-----------------------------------------
Summary: Streaming join should evaluate non-equi conditions on
key-only deletes
Key: FLINK-40858
URL: https://issues.apache.org/jira/browse/FLINK-40858
Project: Flink
Issue Type: Bug
Components: Table SQL / API
Affects Versions: 2.1.3, 2.2.1, 2.3.0
Reporter: Gustavo de Morais
When a join input's upsert key contains the join key, the planner allows
key-only deletes (ChangelogMode#keyOnlyDeletes) into the join. The deletion
itself is correct, because the join removes the stored record by its unique
key. But the operator then evaluates the non-equi condition against the
incoming delete record, whose non-key columns are null. So it may retract the
wrong matches or none at all, which leaves stale joined rows and wrong null
padding.
Example: {{{}L LEFT JOIN R ON L.k = R.k AND R.v > L.v{}}}, where R is an upsert
source with key-only deletes and the sink supports deletes by key.
{code:java}
+I L(k=1, v=5)
+I R(id=1, k=1, v=10) -> +I[L, R]
-D R(id=1, k=1) -> v is null, condition is false, [L, R] is never
retracted {code}
Related: FLINK-40841.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)