HeartSaVioR opened a new pull request, #60283:
URL: https://github.com/apache/spark/pull/60283

   ### What changes were proposed in this pull request?
   
   This PR requires a timestamp state column when the analyzer validates the 
range bound of a streaming outer or semi join.
   
   **Stack.** This is PR 5 of 7 and depends on #60282. Until the earlier PRs 
merge, this PR also shows their commits. Please review only the last commit, 
`bc4367d9300`. 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. (PR to follow) 
[SPARK-61348](https://issues.apache.org/jira/browse/SPARK-61348): Reject 
numeric state bounds in stream-stream outer joins (this PR)
   6. (PR to follow) 
[SPARK-61349](https://issues.apache.org/jira/browse/SPARK-61349): Ignore 
constant-only bounds in stream-stream join state eviction
   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 bound such as `n > CAST(rightTime AS BIGINT)` on a numeric state column 
no longer makes an outer or semi join valid.
   - The migration guide and the join guide state that numeric bounds do not 
qualify.
   
   The checkpoint version is unchanged, because this PR changes only which 
queries pass analysis.
   
   ### Why are the changes needed?
   
   The analyzer accepted `n > CAST(rightTime AS BIGINT)`, although runtime 
range eviction handles only timestamp state columns. The accepted outer join 
could never finalize its unmatched rows.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Outer and semi joins whose only bound is on a numeric state column fail 
analysis. Timestamp range joins remain supported.
   
   ### How was this patch tested?
   
   All commands below passed on this branch, rebased on Apache Spark master: 
831 tests, 0 failures.
   
   ```sh
   build/sbt 'catalyst/testOnly *StreamingJoinHelperSuite 
*UnsupportedOperationsSuite'  # 297
   build/sbt 'sql/testOnly *StreamingJoinWatermarkAdmissionSuite 
*StreamingJoinEqualityOutputWatermarkSuite *StreamingJoinSelectedEventTimeSuite 
*StreamingJoinNumericWatermarkSuite *StreamingJoinOutputWatermarkSuite 
*StreamingJoinEqualityWatermarkSuite *StreamingJoinOneSidedWatermarkSuite 
*StreamingJoinRangeWatermarkSuite *StreamingJoinRangeEvictionSuite 
*StreamingSymmetricHashJoinHelperSuite *MultiStatefulOperatorsSuite 
*OffsetSeqLogSuite *SymmetricHashJoinStateManagerSuite 
*SymmetricHashJoinStateManagerEventTimeInKeySuite'  # 215
   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 new query test failed before the fix: the left outer query started 
instead of throwing `AnalysisException`. It runs once, because analysis rejects 
the plan before any state format is used.
   
   ### 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]

Reply via email to