Skip to content

Conversation

kaushiksrini
Copy link

@kaushiksrini kaushiksrini commented Oct 9, 2025

Which issue does this PR close?

What changes are included in this PR?

  • Adds table_properties.rs to hold and validate properties and set default values. Uses macros to simplify setting new properties.

Are these changes tested?

Yes

Copy link
Contributor

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kaushiksrini for this pr. Although this is quite interesting, I feel that this design is a little hard to maintain. What I expected is sth like following:

pub struct TableProperties {
   #[key="commit.retry.num-retries"]
   #[default="4"]
   pub commit_num_retries: usize,
   ...
}

impl TryFrom<&HashMap<String, String>>> for TableProperties {
   // parse by entry key or use default value
}

Note we don't have a defult method for TableProperties, since some values don't have default methods. See https://github.com/apache/iceberg/blob/b15f4ac1795d25f9db5aa1559b677d57d1bacceb/core/src/main/java/org/apache/iceberg/TableProperties.java#L25 for reference.

@kaushiksrini
Copy link
Author

Thanks for clarifying @liurenjie1024 !

From the description, I thought we would want to reuse the values set in #[key=... and #[default=..., which I believe depends on proc macro like how datafusion has it. This requires a separate crate.

I implemented them as declarative macros here, which don't require an extra crate, but agreed it's more to manage.

The latest push uses static types to simplify things; happy to take on the procedural-macro implementation if that works best.

/// Property key for max number of partitions to keep summary stats for.
pub const PROPERTY_WRITE_PARTITION_SUMMARY_LIMIT: &str = "write.summary.partition-limit";
/// Default value for the max number of partitions to keep summary stats for.
pub const PROPERTY_WRITE_PARTITION_SUMMARY_LIMIT_DEFAULT: u64 = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also move the properties above to the new module?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks Shawn, added them!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add table_properties.rs to hold all properties

3 participants