Skip to content

feat: support canonical Bitmap index segments#6869

Open
Xuanwo wants to merge 4 commits into
mainfrom
xuanwo/bitmap-segment-build-path
Open

feat: support canonical Bitmap index segments#6869
Xuanwo wants to merge 4 commits into
mainfrom
xuanwo/bitmap-segment-build-path

Conversation

@Xuanwo
Copy link
Copy Markdown
Collaborator

@Xuanwo Xuanwo commented May 20, 2026

Implements canonical Bitmap segment builds for create_index_uncommitted(fragment_ids=...) by using the normal bitmap layout when no shard_id is requested, while preserving the legacy shard_id / part_* path.

Adds committed multi-segment Bitmap query support so Python users can build segments, commit them, inspect them through describe_indices(), and scan through one logical scalar index.

Relates to OSS-971 and OSS-972.

@github-actions
Copy link
Copy Markdown
Contributor

ACTION NEEDED
Lance follows the Conventional Commits specification for release automation.

The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.

For details on the error please inspect the "PR Title Check" action.

@Xuanwo Xuanwo changed the title Support canonical Bitmap index segments feat: support canonical Bitmap index segments May 20, 2026
@github-actions github-actions Bot added the enhancement New feature or request label May 20, 2026
@Xuanwo Xuanwo marked this pull request as ready for review May 20, 2026 11:16
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Member

@westonpace westonpace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some questions, I probably just need to get up to speed on these concepts.

Comment on lines +3265 to +3267
return self._ds.create_index(
[column], index_type, name, replace, train, None, kwargs
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you document what is being returned?

Comment on lines +3966 to +3967
IndexConfig(index_type="bitmap", parameters={})
if isinstance(index_type, str) and index_type.upper() == "BITMAP"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused. If index_type == "BITMAP" you are switching to IndexConfig here (with no parameters) and then calling create_scalar_index but in create_scalar_index you also look for index_type == "BITMAP" but how would that ever be true?

Comment on lines +450 to +456
let mut frag_ids = RoaringBitmap::new();
for key in self.index_map.keys() {
let bitmap = self.load_bitmap(key, None).await?;
frag_ids.extend(bitmap.iter().map(|(fragment_id, _)| *fragment_id));
}
frag_ids.extend(self.null_map.iter().map(|(fragment_id, _)| *fragment_id));
Ok(frag_ids)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why implement this method? I thought it was only a utility method for an old migration before we had fragment bitmaps?

raise NotImplementedError(
"Scalar indices currently only support a single column"
)
return self.create_scalar_index(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method is called create_index_uncommitted but if you call create_scalar_index isn't it going to commit the index?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants