HeartSaVioR opened a new pull request, #60284: URL: https://github.com/apache/spark/pull/60284
### What changes were proposed in this pull request? This PR ignores constant-only conditions when deriving an advancing state eviction bound for a stream-stream join. **Stack.** This is PR 6 of 7 and depends on #60283. Until the earlier PRs merge, this PR also shows their commits. Please review only the last commit, `58691f8f798`. Merge order: 1. #60279 [SPARK-61344](https://issues.apache.org/jira/browse/SPARK-61344): Fix stream-stream join range eviction column and output watermark 2. #60280 [SPARK-61345](https://issues.apache.org/jira/browse/SPARK-61345): Fix stream-stream join watermark direction and equality-key eviction 3. #60281 [SPARK-61346](https://issues.apache.org/jira/browse/SPARK-61346): Derive stream-stream join range eviction from the late-filtering event time 4. #60282 [SPARK-61347](https://issues.apache.org/jira/browse/SPARK-61347): Evict stream-stream join range state without a watermark on the stored side 5. #60283 [SPARK-61348](https://issues.apache.org/jira/browse/SPARK-61348): Reject numeric state bounds in stream-stream outer joins 6. (PR to follow) [SPARK-61349](https://issues.apache.org/jira/browse/SPARK-61349): Ignore constant-only bounds in stream-stream join state eviction (this PR) 7. (PR to follow) [SPARK-61350](https://issues.apache.org/jira/browse/SPARK-61350): Reject negative watermark terms in stream-stream join eviction bounds - A conjunct that compares a state column only with a constant, such as `CAST(lt AS BIGINT) > 10`, no longer caps the eviction bound. The opposite-input range bound in the same conjunction is kept. - Raise the checkpoint version to 5. Older checkpoints of affected join shapes are rejected with `STREAMING_JOIN_CHECKPOINT_INCOMPATIBLE` before any state is opened. - The migration guide and the join guide state that constant-only bounds do not qualify. ### Why are the changes needed? For `lt > rt - INTERVAL 5 SECONDS AND CAST(lt AS BIGINT) > 10`, the constant cutoff 10 capped eviction forever. At watermark 39, the valid range cutoff is 34, so an unmatched left row with `lt = 20` must be finalized. ### Does this PR introduce _any_ user-facing change? Yes. Outer joins emit eligible unmatched rows instead of keeping them indefinitely when a constant-only conjunct is present. Outer and semi joins whose only bound is constant fail analysis. ### How was this patch tested? All commands below passed on this branch, rebased on Apache Spark master: 838 tests, 0 failures. ```sh build/sbt 'catalyst/testOnly *StreamingJoinHelperSuite *UnsupportedOperationsSuite' # 301 build/sbt 'sql/testOnly *StreamingJoinWatermarkAdmissionSuite *StreamingJoinEqualityOutputWatermarkSuite *StreamingJoinSelectedEventTimeSuite *StreamingJoinNumericWatermarkSuite *StreamingJoinConstantWatermarkSuite *StreamingJoinOutputWatermarkSuite *StreamingJoinEqualityWatermarkSuite *StreamingJoinOneSidedWatermarkSuite *StreamingJoinRangeWatermarkSuite *StreamingJoinRangeEvictionSuite *StreamingSymmetricHashJoinHelperSuite *MultiStatefulOperatorsSuite *OffsetSeqLogSuite *SymmetricHashJoinStateManagerSuite *SymmetricHashJoinStateManagerEventTimeInKeySuite' # 218 build/sbt 'sql/testOnly *StreamingJoinCheckpointCompatibilitySuite *StreamingJoinRangeEvictionCheckpointSuite' # 223 build/sbt 'sql/testOnly *StreamingInnerJoin*Suite -- -z "matching scan on event time"' # 90 build/sbt 'sql/testOnly *StreamingFullOuterJoinV4Suite -- -z "null" -z "ordinal"' # 6 ``` Scalastyle for catalyst and sql, main and test sources: 0 errors, 0 warnings. The outer-join test failed before the fix in V2, V3 and V4. The mixed-conjunct helper assertion returned 10000 before the fix instead of the expected 15000. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: OpenAI Codex (GPT-6) and Anthropic 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]
