JanKaul commented on code in PR #29:
URL: https://github.com/apache/iceberg-rust/pull/29#discussion_r1297139959


##########
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:
   `SchemaV1` (and `SchemaV2`) are internal structs and are not visible to a 
user of the library. `SchemaV1` is just used for serialization/deserialization. 
We can still do your recommended conversion.
   
   The only publicly visible struct for a schema is the `Schema` struct, which 
has the same representation for v1 and v2 tables.



-- 
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]

Reply via email to