emkornfield commented on code in PR #1851:
URL: https://github.com/apache/iceberg-rust/pull/1851#discussion_r2543690069
##########
crates/iceberg/src/spec/table_properties.rs:
##########
@@ -34,6 +34,25 @@ where
})
}
+// Helper function to parse an optional property from a HashMap
+// If the property is not found, returns None
+fn parse_optional_property<T: std::str::FromStr>(
+ properties: &HashMap<String, String>,
+ key: &str,
+) -> Result<Option<T>, anyhow::Error>
Review Comment:
> I think in iceberg all table properties are optional, if they have default
values, then we should return a default value, otherwise we should return an
error.
The problem here is that the default value is dependent on the value for
compression, it seems baking this into the parsing layer is coupling two
concerns (business logic for parsing) and the actual values. To eliminate this
method I've used a sentinel value for the old method. Let me know if that is
seems OK.
--
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]