alamb commented on code in PR #8313:
URL: https://github.com/apache/arrow-rs/pull/8313#discussion_r2345281913


##########
parquet/src/file/metadata/reader.rs:
##########
@@ -1065,116 +962,17 @@ impl ParquetMetaDataReader {
     ///
     /// [Parquet Spec]: https://github.com/apache/parquet-format#metadata
     pub fn decode_metadata(buf: &[u8]) -> Result<ParquetMetaData> {
-        let mut prot = TCompactSliceInputProtocol::new(buf);
-
-        let t_file_metadata = 
crate::format::FileMetaData::read_from_in_protocol(&mut prot)
-            .map_err(|e| general_err!("Could not parse metadata: {}", e))?;
-        let schema = types::from_thrift(&t_file_metadata.schema)?;
-        let schema_descr = Arc::new(SchemaDescriptor::new(schema));
-
-        let mut row_groups = Vec::new();
-        for rg in t_file_metadata.row_groups {
-            
row_groups.push(RowGroupMetaData::from_thrift(schema_descr.clone(), rg)?);
-        }
-        let column_orders =
-            Self::parse_column_orders(t_file_metadata.column_orders, 
&schema_descr)?;
-
-        let key_value_metadata = t_file_metadata.key_value_metadata.map(|vkv| {
-            vkv.into_iter()
-                .map(|kv| KeyValue::new(kv.key, kv.value))
-                .collect::<Vec<KeyValue>>()
-        });
-
-        let file_metadata = FileMetaData::new(
-            t_file_metadata.version,
-            t_file_metadata.num_rows,
-            t_file_metadata.created_by,
-            key_value_metadata,
-            schema_descr,
-            column_orders,
-        );
-
-        Ok(ParquetMetaData::new(file_metadata, row_groups))
-    }
-
-    /// create meta data from thrift encoded bytes
-    pub fn decode_file_metadata(buf: &[u8]) -> Result<ParquetMetaData> {
         let mut prot = ThriftCompactInputProtocol::new(buf);

Review Comment:
   
![2a5662a25de3a724f5ac08965d275233](https://github.com/user-attachments/assets/482f8100-a12d-40b4-b844-782d5ad86ab8)
   



##########
parquet/src/file/metadata/reader.rs:
##########
@@ -960,101 +947,11 @@ impl ParquetMetaDataReader {
         encrypted_footer: bool,
         file_decryption_properties: Option<&FileDecryptionProperties>,
     ) -> Result<ParquetMetaData> {
-        let mut prot = TCompactSliceInputProtocol::new(buf);

Review Comment:
   FYI I am messing with this code as part of 
https://github.com/apache/arrow-rs/pull/8340 (mostly I moved where it lives) -- 
that isn't a problem per se, I am just giving you a heads up so we can 
coordinate what to merge when in what order, etc



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to