moomindani commented on code in PR #2802:
URL: https://github.com/apache/iceberg-rust/pull/2802#discussion_r4462111745
##########
crates/iceberg/src/spec/partition.rs:
##########
@@ -264,21 +324,80 @@ impl PartitionKey {
pub type UnboundPartitionSpecRef = Arc<UnboundPartitionSpec>;
/// Unbound partition field can be built without a schema and later bound to a
schema.
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, TypedBuilder)]
-#[serde(rename_all = "kebab-case")]
+#[serde(
+ try_from = "_serde_unbound_partition_field::UnboundPartitionFieldSerde",
+ into = "_serde_unbound_partition_field::UnboundPartitionFieldSerde"
+)]
pub struct UnboundPartitionField {
/// A source column id from the table’s schema
pub source_id: i32,
+ /// Source column ids when the transform takes multiple arguments (v3
multi-argument
+ /// transforms). `None` for single-argument transforms, where `source_id`
is used instead.
+ /// When set, `source_id` holds the first id so that existing consumers
keep working.
+ #[builder(default)]
+ pub source_ids: Option<Vec<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.
#[builder(default, setter(strip_option(fallback = field_id_opt)))]
- #[serde(skip_serializing_if = "Option::is_none")]
pub field_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,
}
+mod _serde_unbound_partition_field {
Review Comment:
Done, both serde structs live in the one `_serde` module and share the
read/write rules.
--
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]