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


##########
parquet/src/file/metadata/reader.rs:
##########
@@ -0,0 +1,687 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::{io::Read, ops::Range, sync::Arc};
+
+use bytes::Bytes;
+
+use crate::basic::ColumnOrder;
+use crate::errors::{ParquetError, Result};
+use crate::file::metadata::{FileMetaData, ParquetMetaData, RowGroupMetaData};
+use crate::file::page_index::index::Index;
+use crate::file::page_index::index_reader::{acc_range, decode_column_index, 
decode_offset_index};
+use crate::file::reader::ChunkReader;
+use crate::file::{FOOTER_SIZE, PARQUET_MAGIC};
+use crate::format::{ColumnOrder as TColumnOrder, FileMetaData as 
TFileMetaData};
+use crate::schema::types;
+use crate::schema::types::SchemaDescriptor;
+use crate::thrift::{TCompactSliceInputProtocol, TSerializable};
+
+#[cfg(feature = "async")]
+use crate::arrow::async_reader::MetadataFetch;
+
+/// Reads the [`ParquetMetaData`] from the footer of a Parquet file.
+///
+/// This function is a wrapper around [`ParquetMetaDataReader`]. The input, 
which must implement
+/// [`ChunkReader`], may be a [`std::fs::File`] or [`Bytes`]. In the latter 
case, the passed in
+/// buffer must contain the contents of the entire file if any of the Parquet 
[Page Index]
+/// structures are to be populated (controlled via the `column_index` and 
`offset_index`
+/// arguments).
+///
+/// [Page Index]: 
https://github.com/apache/parquet-format/blob/master/PageIndex.md
+pub fn parquet_metadata_from_file<R: ChunkReader>(

Review Comment:
   Yes, that seems reasonable. And yes, I struggle with naming things 😄.



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