HeartSaVioR opened a new pull request, #60669:
URL: https://github.com/apache/spark/pull/60669
### What changes were proposed in this pull request?
A stream-stream join derives a range cutoff for an input only if that input
has its own
watermark, although the cutoff comes from the other input's watermark. This
PR also derives it
for an input without a watermark, by the TIMESTAMP column that the condition
bounds.
In scope:
- removing that requirement (one condition);
- state format version 4 checkpoints of an earlier version fail with "start
a new checkpoint"
(the check from the parent PR).
Out of scope: the join's output watermark, analysis rules for such inputs,
and legacy mode
(`allowMultiple=false`), which keeps the previous behavior.
### Why are the changes needed?
```sql
-- only rightTime has a watermark (10 seconds)
SELECT * FROM l LEFT OUTER JOIN r
ON leftKey = rightKey
AND leftTime BETWEEN rightTime - INTERVAL 5 SECONDS AND rightTime +
INTERVAL 5 SECONDS
```
Left `(1, 5 s)` has no match. Once the right watermark passes 10 s it can
never match, but
Spark keeps it in state forever and never emits `(1, null)`.
### Does this PR introduce _any_ user-facing change?
Yes. Such joins emit their unmatched rows and bound their state; V4
checkpoints of this shape
need a new checkpoint. Migration guide updated.
### How was this patch tested?
New `StreamingJoinOneSidedWatermarkSuite` (V2-V4, left and right outer, with
a restart), a V4
restart case and a unit test. They fail on the parent PRs.
### Note for reviewers, including AI review
This PR is stacked on #60667 (SPARK-61988, range eviction) and #60664
(SPARK-61985, positive-sign cutoff). Please review only
this PR's own commit. For each finding, give a runnable reproducer and say
whether master has
the same behavior.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 5.5
This pull request and its description were written by Isaac.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]