[SPARK-56546][SQL][FOLLOWUP] Address review comments in segment-tree window frame#55815
Open
cloud-fan wants to merge 1 commit into
Open
[SPARK-56546][SQL][FOLLOWUP] Address review comments in segment-tree window frame#55815cloud-fan wants to merge 1 commit into
cloud-fan wants to merge 1 commit into
Conversation
…window frame ### What changes were proposed in this pull request? Four small cleanups in the segment-tree moving-frame window code: 1. `WindowEvaluatorFactoryBase.scala` -- fix terminology in the `def processor` comment. The comment says `Keep as def (by-name)`, but `def processor(index: Int)` is a parameterized method, not a by-name parameter (`=> T`). Reword to `Keep as def (lazy / per-call)`. 2. `WindowEvaluatorFactoryBase.eligibleForSegTree` -- add a defensive `case _ => false` to the `frameType match` so future additions to the sealed `FrameType` trait do not silently throw `MatchError` at runtime. 3. `WindowEvaluatorFactoryBase.estimateMaxCachedBlocks` -- add a comment justifying the `+ 2` slack in the cached-block budget (one boundary block at each end of the frame's interval), since the magic number was not previously explained. 4. `WindowSegmentTreeSuite.scala` -- fix indentation of 11 `test(` blocks that were declared at 4-space indent (inconsistent with the file's 2-space convention and the 3 other correctly-indented tests in the same file). ### Why are the changes needed? Review-comment-style follow-ups. Pure comment / defensive-default / whitespace changes -- no behavior change. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing tests cover all touched code paths. The test indentation fix is whitespace-only; the comment and `case _` changes have no runtime effect. A separate follow-up is needed to add RANGE-frame coverage to `WindowBenchmark` -- the current benchmark is RowFrame-only -- but that requires regenerating the committed JDK 17/21/25 results files and is deferred. Co-authored-by: Isaac
8872c3c to
bdca187
Compare
Contributor
Author
|
cc @yaooqinn |
LuciferYang
approved these changes
May 12, 2026
dongjoon-hyun
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Four small cleanups in the segment-tree moving-frame window code introduced by #55422:
WindowEvaluatorFactoryBase.scala-- fix terminology in thedef processorcomment. The comment saysKeep as def (by-name), butdef processor(index: Int)is a parameterized method, not a by-name parameter (=> T). Reword toKeep as def (lazy / per-call).WindowEvaluatorFactoryBase.eligibleForSegTree-- add a defensivecase _ => falseto theframeType matchso future additions to the sealedFrameTypetrait do not silently throwMatchErrorat runtime.WindowEvaluatorFactoryBase.estimateMaxCachedBlocks-- add a comment justifying the+ 2slack in the cached-block budget (one boundary block at each end of the frame's interval), since the magic number was not previously explained.WindowSegmentTreeSuite.scala-- fix indentation of 11test(blocks that were declared at 4-space indent (inconsistent with the file's 2-space convention and the 3 other correctly-indented tests in the same file).A separate follow-up is needed to add RANGE-frame coverage to
WindowBenchmark-- the current benchmark is RowFrame-only -- but that requires regenerating the committed JDK 17/21/25 results files and is deferred.Why are the changes needed?
Review-comment-style follow-ups. Pure comment / defensive-default / whitespace changes -- no behavior change.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing tests cover all touched code paths. The test indentation fix is whitespace-only; the comment and
case _changes have no runtime effect.Was this patch authored or co-authored using generative AI tooling?
Yes, Claude assisted in identifying and drafting these cleanups.