You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: store TableSchema partition columns as Fields
Store `TableSchema::table_partition_cols` as `arrow::datatypes::Fields`
(an immutable `Arc<[FieldRef]>`) instead of `Arc<Vec<FieldRef>>`.
Now that `with_table_partition_cols` replaces rather than appends, the
inner `Vec` only existed to support in-place `extend`. `Fields` is the
idiomatic Arrow type for an immutable field list: it is a single
`Arc<[FieldRef]>` (one fewer indirection than `Arc<Vec<_>>`), can be
shared zero-copy with an existing schema, and makes the shared-`Arc`
mutation panic that motivated the replace change structurally impossible
-- there is no `Vec` to `Arc::get_mut`/`make_mut`.
`TableSchema::table_partition_cols()` and the delegating
`FileScanConfig::table_partition_cols()` now return `&Fields`. `Fields`
derefs to `&[FieldRef]`, so iteration/indexing/`len`/`is_empty` callers
are unchanged; only the arrow `FileFormat` path needed `.to_vec()` to
rebuild an owned `Vec`. The constructors still take `Vec<FieldRef>`, so
no call site that builds partition columns changes.
Documented the `&Fields` return-type change in the 54.0.0 upgrade guide.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments