kacper-li-airspace-intelligence commented on code in PR #3224:
URL: https://github.com/apache/iceberg-rust/pull/3224#discussion_r4267244254


##########
crates/iceberg/src/spec/manifest_list/mod.rs:
##########
@@ -59,25 +58,22 @@ pub struct ManifestList {
 impl ManifestList {
     /// Parse manifest list from bytes.
     pub fn parse_with_version(bs: &[u8], version: FormatVersion) -> 
Result<ManifestList> {
-        match version {
-            FormatVersion::V1 => {
-                let reader = Reader::builder(bs)
-                    .reader_schema(&MANIFEST_LIST_AVRO_SCHEMA_V1)
-                    .build()?;
-                let values = 
Value::Array(reader.collect::<std::result::Result<Vec<Value>, _>>()?);
-                from_value::<_serde::ManifestListV1>(&values)?.try_into()
-            }
-            FormatVersion::V2 => {
-                let reader = Reader::new(bs)?;
-                let values = 
Value::Array(reader.collect::<std::result::Result<Vec<Value>, _>>()?);
-                from_value::<_serde::ManifestListV2>(&values)?.try_into()
-            }
-            FormatVersion::V3 => {
-                let reader = Reader::new(bs)?;
-                let values = 
Value::Array(reader.collect::<std::result::Result<Vec<Value>, _>>()?);
-                from_value::<_serde::ManifestListV3>(&values)?.try_into()
-            }
-        }
+        let reader = Reader::new(bs)?;
+        let entries = match version {
+            FormatVersion::V1 => reader
+                .into_deser_iter::<Resolved<_serde::ManifestFileV1>>()
+                .map(|entry| entry?.0.try_into())
+                .collect::<Result<Vec<_>>>()?,

Review Comment:
   Great find, opened https://github.com/apache/iceberg-rust/issues/3445



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