You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "nicholaschew11 (via GitHub)" <gi...@apache.org> on 2026/03/13 18:17:08 UTC
[PR] [SPARK-55987][SS] Fix time window join in stream-stream join state format V4 [spark]
nicholaschew11 opened a new pull request, #54786:
URL: https://github.com/apache/spark/pull/54786
### What changes were proposed in this pull request?
This PR fixes time window joins in stream-stream join state format V4. The V4 state manager was deducing the event time column ordinal in join keys independently per side using `NamedExpression` metadata, which didn't work for window structs. Instead, we now use `StreamingSymmetricHashJoinHelper.findJoinKeyOrdinalForWatermark` which already correctly resolves the watermark ordinal for both sides.
Changes:
- Expose `findJoinKeyOrdinalForWatermark` as `private[join]` in `StreamingSymmetricHashJoinHelper`
- Compute `joinKeyOrdinalForWatermark` in `StreamingSymmetricHashJoinExec` and pass it through `OneSideHashJoiner` to the state manager factory
- Replace `eventTimeColIdxOptInKey` in `SymmetricHashJoinStateManagerV4` with the passed-in `joinKeyOrdinalForWatermark`
- Fix `append()` to try extracting event time from key first, falling back to value
- Remove window join test from V4 skip list since it now passes
### Why are the changes needed?
Stream-stream join V4 state format did not support window struct join keys because the V4 state manager tried to find the event time column in join keys by checking `NamedExpression` metadata independently, which doesn't carry through for window structs. The existing `findJoinKeyOrdinalForWatermark` utility already handles this correctly.
### Does this PR introduce _any_ user-facing change?
No. V4 state format is experimental and gated behind `spark.sql.streaming.join.stateFormatV4.enabled`.
### How was this patch tested?
Existing test `"stream stream inner join on windows - with watermark"` now runs in V4 suites (previously skipped). All 4 V4 join test suites pass (94 tests).
### Was this patch authored or co-authored using generative AI tooling?
Yes.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55987][SS] Fix time window join in stream-stream join state format V4 [spark]
Posted by "HeartSaVioR (via GitHub)" <gi...@apache.org>.
HeartSaVioR commented on PR #54786:
URL: https://github.com/apache/spark/pull/54786#issuecomment-4058179486
Thanks! Merging to master.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55987][SS] Fix time window join in stream-stream join state format V4 [spark]
Posted by "HeartSaVioR (via GitHub)" <gi...@apache.org>.
HeartSaVioR commented on PR #54786:
URL: https://github.com/apache/spark/pull/54786#issuecomment-4058193238
Oh I forgot to ask filling out which LLM model was used to generate the code and put into the PR description. I wish it's OK for one time miss. I checked with @nicholaschew11 and it was Claude 4.6 ops.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55987][SS] Fix time window join in stream-stream join state format V4 [spark]
Posted by "HeartSaVioR (via GitHub)" <gi...@apache.org>.
HeartSaVioR closed pull request #54786: [SPARK-55987][SS] Fix time window join in stream-stream join state format V4
URL: https://github.com/apache/spark/pull/54786
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org