Repository navigation
Construct manifest fetch futures lazily during scans - #421
Merged
Merged
Conversation
JanKaul
approved these changes
Oct 16, 2026
JanKaul
left a comment
Owner
There was a problem hiding this comment.
Great improvement. Thanks for the PR. I left a small comment regarding the instrument call. I would prefer it to leave it as a macro. It should still compile.
Comment on lines
+311
to
+317
| let span = tracing::debug_span!( | ||
| "iceberg_rust::table::datafiles", | ||
| manifest_count = manifests.len(), | ||
| filter_provided = filter.is_some(), | ||
| sequence_range = ?sequence_number_range | ||
| ); | ||
| let _guard = span.enter(); |
Owner
There was a problem hiding this comment.
What's the motivation to move the instrumentation? I would like to keep the coding style with the macro. Does this have any benefits.
Contributor
Author
There was a problem hiding this comment.
Good point; moving the instrumentation has no benefit for this change. I restored #[instrument] in 62d9829 and kept the lazy manifest futures. I also skipped the full filter vector in tracing and added a test that catches eager per-manifest store clones.
Owner
|
Thanks for the PR! Looks good to me |
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
Table::datafilescurrently builds aVecof one fetch/decode future per selected manifest before passing it to a bounded stream. That eagerly clones every manifest URI andArc<ObjectStore>and allocates O(manifest-count) extra state during scan setup, even though onlyconcurrent_manifest_ops()requests can run at once.This change maps manifest entries lazily into futures as the stream is polled. It keeps the existing I/O, ordering, deleted-entry filtering, sequence handling, and bounded concurrency unchanged. The public filter behavior (including short or empty masks) is preserved. The tracing span is entered manually because
#[instrument]cannot return a stream borrowingmanifests.Validation
cargo +1.95.0 test -q -p iceberg-rust --lib: 185 passed, 2060 ignored.cargo +1.95.0 test -p datafusion_iceberg --test integration_df_filters: 18 passed, including partitioned file pruning.cargo +1.95.0 clippy -p iceberg-rust --lib --tests -- -D warnings,cargo +1.95.0 fmt --all -- --check, andgit diff --checkpassed.The analogous change in Embucket/iceberg-rust#116 measured a large improvement for constructing a stream with 100k manifests in a local debug microbenchmark. That measurement covers setup only, not manifest I/O or end-to-end query latency.