etseidl commented on code in PR #6451:
URL: https://github.com/apache/arrow-rs/pull/6451#discussion_r1776091862


##########
parquet/src/file/footer.rs:
##########
@@ -123,137 +70,7 @@ pub fn decode_metadata(buf: &[u8]) -> 
Result<ParquetMetaData> {
 /// | len | 'PAR1' |
 /// +-----+--------+
 /// ```
+#[deprecated(since = "53.1.0", note = "Use 
ParquetMetaDataReader::decode_footer")]
 pub fn decode_footer(slice: &[u8; FOOTER_SIZE]) -> Result<usize> {
-    // check this is indeed a parquet file
-    if slice[4..] != PARQUET_MAGIC {
-        return Err(general_err!("Invalid Parquet file. Corrupt footer"));
-    }
-
-    // get the metadata length from the footer
-    let metadata_len = u32::from_le_bytes(slice[..4].try_into().unwrap());
-    // u32 won't be larger than usize in most cases
-    Ok(metadata_len as usize)
-}
-
-/// Parses column orders from Thrift definition.
-/// If no column orders are defined, returns `None`.
-fn parse_column_orders(
-    t_column_orders: Option<Vec<TColumnOrder>>,
-    schema_descr: &SchemaDescriptor,
-) -> Option<Vec<ColumnOrder>> {
-    match t_column_orders {
-        Some(orders) => {
-            // Should always be the case
-            assert_eq!(
-                orders.len(),
-                schema_descr.num_columns(),
-                "Column order length mismatch"
-            );
-            let mut res = Vec::new();
-            for (i, column) in schema_descr.columns().iter().enumerate() {
-                match orders[i] {
-                    TColumnOrder::TYPEORDER(_) => {
-                        let sort_order = ColumnOrder::get_sort_order(
-                            column.logical_type(),
-                            column.converted_type(),
-                            column.physical_type(),
-                        );
-                        res.push(ColumnOrder::TYPE_DEFINED_ORDER(sort_order));
-                    }
-                }
-            }
-            Some(res)
-        }
-        None => None,
-    }
-}
-
-#[cfg(test)]
-mod tests {

Review Comment:
   These tests are all replicated in `parquet/src/file/metadata/reader.rs`



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

Reply via email to