my-vegetable-has-exploded commented on code in PR #106: URL: https://github.com/apache/iceberg-rust/pull/106#discussion_r1410082084
########## crates/iceberg/src/spec/partition.rs: ########## @@ -60,6 +62,99 @@ impl PartitionSpec { } } +static PARTITION_DATA_ID_START: i32 = 1000; + +/// Reference to [`UnboundPartitionSpec`]. +pub type UnboundPartitionSpecRef = Arc<UnboundPartitionSpec>; +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)] +#[serde(rename_all = "kebab-case")] +/// Unbound partition field can be built without a schema and later bound to a schema. +pub struct UnboundPartitionField { + /// A source column id from the table’s schema + pub source_id: i32, + /// A partition field id that is used to identify a partition field and is unique within a partition spec. + /// In v2 table metadata, it is unique across all partition specs. + pub partition_id: Option<i32>, + /// A partition name. + pub name: String, + /// A transform that is applied to the source column to produce a partition value. + pub transform: Transform, +} + +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, Default, Builder)] Review Comment: I don't find a neat way to add ``` #[builder(setter(each(name = "with_partition_field")))]``` in TypedBuilder. Accoding to [this](https://github.com/idanarye/rust-typed-builder/blob/168e076bae35399040a1c973901161023e48e13b/src/lib.rs#L218C19-L218C27), it may need to use mutators? Maybe we can try later? -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org