liurenjie1024 commented on code in PR #76:
URL: https://github.com/apache/iceberg-rust/pull/76#discussion_r1354363331


##########
crates/iceberg/src/spec/manifest_list.rs:
##########
@@ -90,24 +113,72 @@ impl ManifestList {
         ];
         Schema::builder().with_fields(fields).build().unwrap()
     }
+}
 
-    /// Get the v1 schema of the manifest list entry.
-    pub(crate) fn v1_schema() -> Schema {
-        let fields = vec![
-            _const_fields::MANIFEST_PATH.clone(),
-            _const_fields::MANIFEST_LENGTH.clone(),
-            _const_fields::PARTITION_SPEC_ID.clone(),
-            _const_fields::ADDED_SNAPSHOT_ID.clone(),
-            _const_fields::ADDED_FILES_COUNT_V1.clone().to_owned(),
-            _const_fields::EXISTING_FILES_COUNT_V1.clone(),
-            _const_fields::DELETED_FILES_COUNT_V1.clone(),
-            _const_fields::ADDED_ROWS_COUNT_V1.clone(),
-            _const_fields::EXISTING_ROWS_COUNT_V1.clone(),
-            _const_fields::DELETED_ROWS_COUNT_V1.clone(),
-            _const_fields::PARTITIONS.clone(),
-            _const_fields::KEY_METADATA.clone(),
-        ];
-        Schema::builder().with_fields(fields).build().unwrap()
+pub(crate) static MANIFEST_LIST_AVRO_SCHEMA_V1: Lazy<AvroSchema> =

Review Comment:
   ```suggestion
   static MANIFEST_LIST_AVRO_SCHEMA_V1: Lazy<AvroSchema> =
   ```



##########
crates/iceberg/src/spec/manifest_list.rs:
##########
@@ -69,6 +73,25 @@ impl ManifestList {
         &self.entries
     }
 
+    /// Get the v1 schema of the manifest list entry.
+    pub(crate) fn v1_schema() -> Schema {

Review Comment:
   How about narrowing down it to `private`?



##########
crates/iceberg/src/spec/manifest_list.rs:
##########
@@ -90,24 +113,72 @@ impl ManifestList {
         ];
         Schema::builder().with_fields(fields).build().unwrap()
     }
+}
 
-    /// Get the v1 schema of the manifest list entry.
-    pub(crate) fn v1_schema() -> Schema {
-        let fields = vec![
-            _const_fields::MANIFEST_PATH.clone(),
-            _const_fields::MANIFEST_LENGTH.clone(),
-            _const_fields::PARTITION_SPEC_ID.clone(),
-            _const_fields::ADDED_SNAPSHOT_ID.clone(),
-            _const_fields::ADDED_FILES_COUNT_V1.clone().to_owned(),
-            _const_fields::EXISTING_FILES_COUNT_V1.clone(),
-            _const_fields::DELETED_FILES_COUNT_V1.clone(),
-            _const_fields::ADDED_ROWS_COUNT_V1.clone(),
-            _const_fields::EXISTING_ROWS_COUNT_V1.clone(),
-            _const_fields::DELETED_ROWS_COUNT_V1.clone(),
-            _const_fields::PARTITIONS.clone(),
-            _const_fields::KEY_METADATA.clone(),
-        ];
-        Schema::builder().with_fields(fields).build().unwrap()
+pub(crate) static MANIFEST_LIST_AVRO_SCHEMA_V1: Lazy<AvroSchema> =
+    Lazy::new(|| schema_to_avro_schema("manifest_list", 
&ManifestList::v1_schema()).unwrap());
+
+pub(crate) static MANIFEST_LIST_AVRO_SCHEMA_V2: Lazy<AvroSchema> =

Review Comment:
   ```suggestion
   static MANIFEST_LIST_AVRO_SCHEMA_V2: Lazy<AvroSchema> =
   ```



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

Reply via email to