Repository navigation
refactor(spec)!: accept impl Into<Type> in NestedField constructors - #3527
Merged
Merged
Conversation
Co-authored-by: Danny C Jones <djonesoa@amazon.com>
There was a problem hiding this comment.
🟢 Approval recommended
The mechanical conversion preserves constructor semantics, and the affected callers and public API snapshot consistently reflect the intended breaking change.
No open issues 🎉
What changed in this PR
Improves schema-construction ergonomics by accepting impl Into<Type> in NestedField and MapType constructors while preserving their behavior. This intentionally breaks type inference for callers that pass an unqualified .into() expression.
Changes:
- Move type conversion into the constructors.
- Update affected tests and fixtures to pass types directly.
- Synchronize the public API snapshot with the new signatures.
| File | Description |
|---|---|
crates/iceberg/src/test_utils/scan.rs |
Adapt scan fixtures to the new constructor signatures. |
crates/iceberg/src/spec/partition.rs |
Update partition-test field construction. |
crates/iceberg/src/spec/datatypes.rs |
Accept convertible types in field and map constructors. |
crates/iceberg/src/scan/mod.rs |
Update scan-test schema construction. |
crates/iceberg/src/expr/term.rs |
Update expression-test schema construction. |
crates/iceberg/src/avro/schema.rs |
Adapt Avro schema tests, including nested types. |
crates/iceberg/public-api.txt |
Record the updated public constructor signatures. |
Review effort: Balanced
Contributor
Author
Perseus
pushed a commit
to Perseus/iceberg-rust
that referenced
this pull request
Oct 30, 2026
Backport of apache#3424 (net diff of PR head 86e35d3 against its merge base beba39c), adapted to base 5b82ab9. Adds TableScanBuilder::with_column_stats(names) and FileScanTask::column_stats(). Tasks carry the data file's column sizes, value/null/NaN counts and lower/upper bounds only for the named primitive columns. By default no statistics are kept and behaviour is unchanged. Upstream-PR: apache#3424 Upstream-head: 86e35d3 Backport-notes: scan/mod.rs conflicts resolved for the older base: resolve_field_id keeps its Option return (no apache#3070 ambiguity check), TableScanBuilder keeps snapshot_id (no apache#3260 snapshot_selection), and apache#3070's ambiguity tests are not carried. Datum::promote_to (apache#3483) is inlined as the same int->long / float->double widening in task.rs. Tests use Type::Primitive(..) (pre-apache#3527 NestedField signature) and test_utils imports SchemaRef. Details in DFD_FORK.md. Needed-by: https://github.com/Perseus/datafusion-distributed/tree/iceberg-dyn-filter/f2-fork-column-stats Remove-when: the pinned iceberg-rust rev contains apache#3424's merge commit Issue: apache#3422
Perseus
pushed a commit
to Perseus/iceberg-rust
that referenced
this pull request
Oct 31, 2026
Backport of apache#3424 (net diff of PR head 86e35d3 against its merge base beba39c), adapted to base 5b82ab9. Adds TableScanBuilder::with_column_stats(names) and FileScanTask::column_stats(). Tasks carry the data file's column sizes, value/null/NaN counts and lower/upper bounds only for the named primitive columns. By default no statistics are kept and behaviour is unchanged. Upstream-PR: apache#3424 Upstream-head: 86e35d3 Backport-notes: scan/mod.rs conflicts resolved for the older base: resolve_field_id keeps its Option return (no apache#3070 ambiguity check), TableScanBuilder keeps snapshot_id (no apache#3260 snapshot_selection), and apache#3070's ambiguity tests are not carried. Datum::promote_to (apache#3483) is inlined as the same int->long / float->double widening in task.rs. Tests use Type::Primitive(..) (pre-apache#3527 NestedField signature) and test_utils imports SchemaRef. Details in DFD_FORK.md. Needed-by: https://github.com/Perseus/datafusion-distributed/tree/iceberg-dyn-filter/f2-fork-column-stats Remove-when: the pinned iceberg-rust rev contains apache#3424's merge commit Issue: apache#3422
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?
No open issue for this one.
What changes are included in this PR?
This change introduces
impl Into<Type>intoNestedFieldconstructors to improve ergonomics.This is a breaking change to some callers who already called
.into(). Those are updated. It is not worth going back and changing all callers. This will simplify benefit new callers (mainly tests).Are these changes tested?
N/A
AI Disclosure
Used LLM to do the rewrite, it's very mechanical.