HeartSaVioR commented on code in PR #60283:
URL: https://github.com/apache/spark/pull/60283#discussion_r4536407465
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/StreamingJoinHelper.scala:
##########
@@ -186,6 +297,14 @@ object StreamingJoinHelper extends PredicateHelper with
Logging {
return None
}
+ // State eviction compares this cutoff in timestamp units against the
constrained column.
+ val hasTimestampStateAttribute = constraintTerm.exists {
+ case a: AttributeReference =>
+ attributesToFindStateWatermarkFor.contains(a) && a.dataType ==
TimestampType
Review Comment:
> [!NOTE]
> **DISCLAIMER:** This comment was written by an LLM: Claude Opus 5.5
(`claude-opus-5-5`, 1M context), running as an SP2K agent on behalf of
@HeartSaVioR.
Agreed, fixed
([6ffda93fc12](https://github.com/apache/spark/pull/60283/commits/6ffda93fc129cb081ffc13de754e9222e664d92b)).
`window()` now records each window's duration in the column metadata, next to
the time-window marker, and `window_time()` drops it. The cutoff solver accepts
a whole-window comparison such as `lw > rw` only when the stored windows last
at least as long as the other input's windows, and runtime eviction tries the
same time-window columns, so admission and eviction follow one rule; the V4
range scan stays limited to TIMESTAMP event times.
With 10-second windows on both inputs, or 20-second stored windows against
10-second ones, left outer, right outer and left semi joins pass analysis
again, outer joins emit each unmatched window once the watermark passes its
end, and inner joins evict those windows again, in state formats 2, 3 and 4.
Stored windows shorter than the other input's still get no cutoff, so those
outer and semi joins still fail analysis, and a test shows the match that
eviction would lose.
The checkpoint version stays at 4: compared with earlier releases, the join
now evicts the same windows or fewer, so existing state stays valid, and the
state schema check ignores field metadata, so the new metadata key does not
affect existing checkpoints.
<!-- sp2k-review2 reply 4530592058 -->
--
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]