Conversation
wjones127
added this pull request to stack #9305
September 16, 2026 16:08
This was referenced Sep 16, 2026
wjones127
marked this pull request as ready for review
September 16, 2026 16:22
wjones127
force-pushed
the
feat/json-index-details-target-data-type
branch
from
September 16, 2026 17:43
a0f6a06 to
25d428d
Compare
Populate `JsonIndexDetails.target_data_type`, added to the format in the previous PR, so a JSON index's persisted details describe the type its target index was trained on instead of leaving a rebuild to re-infer it. `JsonIndex` carries the recorded value, parsed from the details at load, and `remap` and `update` copy it forward rather than re-deriving it: `ScalarIndex::training_data_type` is implemented only by BTree, so re-deriving would drop the type for every other target on every compaction, which is the case the issue is about. It is held as the raw enum value so a variant added by a later build survives a compaction performed by this one, as the format requires. Details written before the field existed are upgraded in passing where the type can be recovered: always on the `update` path, which already requires the target to report the type it was trained on, and for BTree targets on the `remap` path. `derive_index_params` reports the type, so a rebuild reproduces it, and `details_as_json` reports it, so it is visible in `list_indices`. Both spell it the same way. `JsonIndex::training_data_type` is deliberately unchanged, so `update` on a non-BTree target still fails as before: that guard is load-bearing, since `BitmapIndex::update` takes its value type from the incoming stream and would merge mismatched keys rather than erroring. Closes #9256 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
wjones127
force-pushed
the
feat/json-index-details-target-data-type
branch
from
September 16, 2026 19:19
25d428d to
d2f44d9
Compare
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The implementation patch is unchanged after the rebase. It records the trained target type, preserves raw values through load, remap, and update—including unknown future variants—and recovers legacy UNSPECIFIED only from the target index, matching the clarified format contract in #9303. Derived rebuild parameters carry the stored type forward.
#9303 remains the prerequisite and should land first.
This branch has not been deployed
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.
Populates
JsonIndexDetails.target_data_type, added to the format in #9303, so a JSON index's persisted details describe the type its target index was trained on instead of leaving a rebuild to re-infer it.The recorded type is read back when an index is loaded and copied forward when it is compacted or updated, rather than asked of the target index each time — only BTree targets can answer that, so re-deriving would keep losing the type for bitmap and every other target on every compaction, which is the case the issue is about. It is held as the raw enum value so a variant written by a newer build survives a compaction performed by this one, as the format requires.
Details written before the field existed are upgraded in passing wherever the type can be recovered: always on the
updatepath, which already requires the target to report the type it was trained on, and for BTree targets on theremappath.derive_index_paramsreports the type so a rebuild reproduces it, andlist_indicesreports it too.Not included
JsonIndex::training_data_typeis deliberately unchanged, soupdateon a non-BTree target still fails as before. That guard is load-bearing:BitmapIndex::updatetakes its value type from the incoming stream and would merge mismatched keys rather than erroring.uv run make lintwas not run:uv syncbuilds the pylance extension, which needs a localpython/Cargo.tomledit in this worktree.ruffandruff-formatwere run over the diff via pre-commit instead.Closes #9256
🤖 Generated with Claude Code
Stack created with GitHub Stacks CLI • Give Feedback 💬