HeartSaVioR commented on PR #60282: URL: https://github.com/apache/spark/pull/60282#issuecomment-6775645693
> [!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. Thanks for the [review](https://github.com/apache/spark/pull/60282#pullrequestreview-5840328937). Answers to the items in its summary; the inline comments are answered in their threads. - **Analysis and execution choose bounded columns by different rules.** Closed by SPARK-61348 (#60283, [f885a5a0876](https://github.com/apache/spark/pull/60283/commits/f885a5a08766d0a1ce402ab9dff35dce9af28b98)): the solver gives a cutoff only for a TIMESTAMP column, so admission and eviction accept the same columns, and DATE, TIMESTAMP_NTZ and numeric bounds fail analysis for outer and semi joins. Constant-only bounds are handled by SPARK-61349 (#60284). See the inline replies. - **Interval arithmetic counts every day as 24 hours.** - Equality keys (SPARK-61345, #60280, [c4bdbf09fdb](https://github.com/apache/spark/pull/60280/commits/c4bdbf09fdbea72fee5ab22ad03b839f1d9d7a37)): whole days and months count as inexact in every time zone. A forward shift gets the unshifted watermark as its cutoff and a backward one gets none, so the key bound and the V4 layout no longer depend on the session time zone. - One-sided range bounds ([4000ae8f0c6](https://github.com/apache/spark/pull/60282/commits/4000ae8f0c6012cd60655a093ed642ce08e68651)): a column without its own watermark gets no cutoff from whole days in a non-fixed-offset zone or from a truncating cast, and admission follows the same rule. - Two-sided range bounds keep the 24-hour day, as on master. That is a known follow-up (SPARK-61381). - **V4 storage and lookup timestamps.** Both parts are fixed in SPARK-61345 (#60280, [c4bdbf09fdb](https://github.com/apache/spark/pull/60280/commits/c4bdbf09fdbea72fee5ab22ad03b839f1d9d7a37)): the key ordinal no longer depends on the session time zone, and a side whose own event time is an equality key looks up its rows with a point get again. - **Shared repair plan 1.** Partly taken ([c4bdbf09fdb](https://github.com/apache/spark/pull/60280/commits/c4bdbf09fdbea72fee5ab22ad03b839f1d9d7a37)). Forward calendar shifts get the unshifted watermark and no event-time bound in every zone, as proposed, and the helper docs say which shifts get which bound. We did not count days conservatively in the solver; that is the range-solver follow-up (SPARK-61381). `timestampadd` keys stay unrecognized; a key written as `rt + INTERVAL 1 HOUR` has a bound. - **Shared repair plan 2.** Done ([c4bdbf09fdb](https://github.com/apache/spark/pull/60280/commits/c4bdbf09fdbea72fee5ab22ad03b839f1d9d7a37)): the scan starts after the lower of the late watermark and the shifted cutoff, and the test adds the boundary row. - **Decision challenge: V4 prefix scans instead of point gets.** We took the second option ([c4bdbf09fdb](https://github.com/apache/spark/pull/60280/commits/c4bdbf09fdbea72fee5ab22ad03b839f1d9d7a37)). A side's V4 state manager now uses its own event-time key ordinal when no opposite key bounds the side and the side is not evicted on another column. The stored timestamps and index entries do not change, so existing state stays readable. In a one-sided join with 200k keys, probe batches went from about 1.3 to 1.5 times slower than master back to master's time. One helper keeps the second ordinal rule in one place, and a unit test covers it. <!-- sp2k-review1 toplevel 60282 --> -- 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]
