feat: add fragment enumeration and fragment-scoped scanning APIs#3
Merged
jja725 merged 3 commits intolance-format:mainfrom Mar 26, 2026
Merged
feat: add fragment enumeration and fragment-scoped scanning APIs#3jja725 merged 3 commits intolance-format:mainfrom
jja725 merged 3 commits intolance-format:mainfrom
Conversation
lance-encoding's build script requires protoc. Install it via apt-get on Linux and brew on macOS. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add three new C API functions for fragment-level access: - lance_dataset_fragment_count() — returns number of fragments - lance_dataset_fragment_ids() — fills caller-allocated array with fragment IDs - lance_scanner_set_fragment_ids() — restricts scan to specific fragments This enables split-based parallelism for query engines like Velox, where each worker scans a subset of fragments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Add three new C API functions for fragment-level access, enabling split-based parallelism for query engines like Velox.
lance_dataset_fragment_count()— returns number of fragments in the datasetlance_dataset_fragment_ids()— fills caller-allocated array with fragment IDslance_scanner_set_fragment_ids()— restricts scan to specific fragment IDsMotivation
Query engines like Velox distribute work across workers by assigning each worker a subset of fragments (splits). Without fragment-level APIs, the connector cannot partition the scan work.
Changes
src/dataset.rslance_dataset_fragment_count,lance_dataset_fragment_idssrc/scanner.rslance_scanner_set_fragment_ids,fragment_idsfield, fragment filtering inmaterialize_streamandbuild_scannerinclude/lance.hinclude/lance.hppDataset::fragment_count(),Dataset::fragment_ids(),Scanner::fragment_ids())tests/c_api_test.rstest_fragment_count,test_fragment_ids,test_scanner_with_fragment_idsTest plan
cargo test— 40 tests pass (3 new fragment tests)cargo clippy --all-targets -- -D warnings— cleancargo fmt -- --check— clean🤖 Generated with Claude Code