[SPARK-58293][ML] Delay VectorIndexerModel attribute initialization#57483
Closed
zhengruifeng wants to merge 3 commits into
Closed
[SPARK-58293][ML] Delay VectorIndexerModel attribute initialization#57483zhengruifeng wants to merge 3 commits into
zhengruifeng wants to merge 3 commits into
Conversation
zhengruifeng
force-pushed
the
delay-partial-feature-attributes-dev3
branch
from
July 24, 2026 02:13
e77f28c to
8f16db8
Compare
HyukjinKwon
approved these changes
Jul 24, 2026
zhengruifeng
added a commit
that referenced
this pull request
Jul 24, 2026
### What changes were proposed in this pull request? Replaces the retained `partialFeatureAttributes` field in `VectorIndexerModel` with an on-demand private method. The attributes are now computed only when output metadata is prepared. ### Why are the changes needed? The attributes are derived state used only while preparing output metadata. Retaining them on every fitted or loaded model allocates one attribute per feature even when the model is never transformed. Computing them at the call site avoids that unnecessary retained state. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? The test suite was not run locally. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Codex Closes #57483 from zhengruifeng/delay-partial-feature-attributes-dev3. Authored-by: Ruifeng Zheng <ruifengz@apache.org> Signed-off-by: Ruifeng Zheng <ruifengz@apache.org> (cherry picked from commit 6d6e2dc) Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
Contributor
Author
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?
Replaces the retained
partialFeatureAttributesfield inVectorIndexerModelwith an on-demand private method. The attributes are now computed only when output metadata is prepared.Why are the changes needed?
The attributes are derived state used only while preparing output metadata. Retaining them on every fitted or loaded model allocates one attribute per feature even when the model is never transformed. Computing them at the call site avoids that unnecessary retained state.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
The test suite was not run locally.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Codex