blackmwk commented on code in PR #3044:
URL: https://github.com/apache/iceberg-rust/pull/3044#discussion_r3870568904
##########
crates/property-macro/README.md:
##########
@@ -211,6 +211,53 @@ fn main() -> iceberg::Result<()> {
}
```
+## Borrowed property views
+
+`properties_view!` defines a lightweight borrowed view over a flat property
+map. Its struct-shaped fields are property declarations rather than stored
+fields. Constructing the view does not parse anything; each generated getter
+parses and returns only its declared property. Missing properties use their
+annotated defaults, while invalid configured values return an error from the
+corresponding getter.
+
+```rust
+use std::collections::HashMap;
+
+use iceberg_property_macro::properties_view;
+
+properties_view! {
+ #[derive(Debug)]
+ pub struct WriteProperties {
+ /// Number of times to retry a commit.
+ #[property(key = "commit.retry.num-retries", default = 4)]
+ pub commit_num_retries: usize,
+
+ /// Optional base directory for metadata files.
+ #[property(key = "write.metadata.path", default = None)]
+ pub write_metadata_path: Option<String>,
Review Comment:
```suggestion
raw_write_metadata_path: Option<String>,
```
I hope to see example of defining write_metadata_path as following: If
write_metadata_path exists, then return it. Otherwise we should return "<table
path>/metadata". And user could provide the logic in a "pub fn
write_metadata_path()"
--
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]