Repository navigation
refactor: replace IcebergDataSource::new_with_predicate with a builder - #63
Merged
Merged
Conversation
gabotechs
reviewed
Oct 11, 2026
NoahKusaba
force-pushed
the
feat/data-source-builder
branch
from
October 11, 2026 17:13
4fd759e to
cec4bf7
Compare
NoahKusaba
force-pushed
the
feat/data-source-builder
branch
from
October 11, 2026 17:43
cec4bf7 to
1cd1ec2
Compare
5 of 40 tasks
gabotechs
approved these changes
Oct 12, 2026
gabotechs
left a comment
Contributor
There was a problem hiding this comment.
👍 nice, thanks @NoahKusaba!
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.
Which issue does this PR close?
Rationale for this change
#20 made
IcebergDataSource::new_with_predicatepublic so that a codec can rebuild a scan from its accessors. It takes every part of the scan as a positional argument. A scan option added later would mean adding an argument, which is a breaking change. A builder lets new options be added without breaking callers.What changes are included in this PR?
Replaces
IcebergDataSource::new_with_predicatewithIcebergDataSource::builder(table, schema), exported fromiceberg_datafusion::readasIcebergDataSourceBuilder. It has these setters:with_projection(Option<&Vec<usize>>): selects columns ofschemaby index, asTableProvider::scanpasses them.with_snapshot_id(Option<i64>)with_filters(&[Expr]): converts DataFusion filters to an Iceberg predicate.with_predicate(Option<Predicate>): sets an already-converted predicate.with_fetch(Option<usize>)The
Optionsetters let a codec pass the accessors' values straight through.build()returns aResult, because a projection index can be out of range.Removes the crate-internal positional constructor
IcebergDataSource::new. Both table providers now build their scans with the builder.Renames the accessor
predicates()topredicate(), since it returns a singlePredicate.Are there any user-facing changes?
Yes.
IcebergDataSource::new_with_predicateis removed in favor of the builder, andIcebergDataSource::predicates()is renamed topredicate(). Both were added in #20 and aren't in any release.Are these changes tested?
Yes.
with_projectionreturns columns in the projection's order and rejects an out-of-range index.