c-thiel commented on code in PR #2188:
URL: https://github.com/apache/iceberg-rust/pull/2188#discussion_r3363047823
##########
crates/iceberg/src/spec/schema/mod.rs:
##########
@@ -421,6 +425,85 @@ impl Schema {
pub fn field_id_to_fields(&self) -> &HashMap<i32, NestedFieldRef> {
&self.id_to_field
}
+
+ /// Minimum [`FormatVersion`] required to represent all *types* in this
schema.
+ ///
+ /// Types only; for initial-default version floors see
[`Schema::check_format_compatibility`].
+ pub fn min_format_version(&self) -> FormatVersion {
Review Comment:
https://github.com/apache/iceberg-rust/pull/2188/commits/15884b99c2faffd770c00865280bbe574b0c526e
Renamed to `calc_min_compatible_format` and doc'd that it walks every field.
Skipped the lazy field because: the only caller is datafusion's
`register_table` today — once per `CREATE TABLE`, never a hot path. Caching a
once-per-table O(fields) call would add a field to Schema (and to its
Clone/serde/Eq surface) for not much win. Easy to add later, non-breaking, if a
hot consumer ever appears.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]