Fokko commented on code in PR #29:
URL: https://github.com/apache/iceberg-rust/pull/29#discussion_r1296992881
##########
crates/iceberg/src/spec/schema.rs:
##########
@@ -609,13 +611,88 @@ impl SchemaVisitor for IndexByName {
}
}
+#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
+#[serde(rename_all = "kebab-case")]
+/// Names and types of fields in a table.
+pub(crate) struct SchemaV2 {
+ /// Identifier of the schema
+ pub schema_id: i32,
+ /// Set of primitive fields that identify rows in a table.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub identifier_field_ids: Option<Vec<i32>>,
+
+ #[serde(flatten)]
+ /// The struct fields
+ pub fields: StructType,
+}
+
+#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
+#[serde(rename_all = "kebab-case")]
+/// Names and types of fields in a table.
+pub(crate) struct SchemaV1 {
Review Comment:
Do we really need the `SchemaV1`. What we do in PyIceberg is when reading a
V1, and when encounter a Schema in the `schema` field:

We just set the schema-id to 0, and add the schema to the schema's field. We
consider the metadata equivalent.
--
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]