adriangb commented on code in PR #6081: URL: https://github.com/apache/arrow-rs/pull/6081#discussion_r1706318222
########## parquet/examples/external_metadata.rs: ########## @@ -0,0 +1,114 @@ +// 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 arrow_array::RecordBatch; +use arrow_cast::pretty::pretty_format_batches; +use parquet::arrow::ParquetRecordBatchStreamBuilder; +use parquet::file::metadata::ParquetMetaData; +use std::path::Path; + +/// This example demonstrates advanced usage of Parquet metadata. +/// +/// This is designed to show how to store Parquet metadata somewhere other than +/// the Parquet file itself, and how to use that metadata to read the file. This +/// can be used, for example, to store metadata for parquet files on remote +/// object storage (e.g. S3) in a local file, use a query engine like +/// DataFusion to figure out which files to read, and then read the files with a +/// single object store request. +/// +/// Specifically it: +/// 1. It reads the metadata of a Parquet file +/// 2. Removes some column statistics from the metadata (to make them smaller) +/// 3. Stores the metadata in a separate file +/// 4. Reads the metadata from the separate file and uses that to read the Parquet file Review Comment: File is fine by me 😄. Maybe a comment about storing the metadata in a fast cache like Redis or in a metadata store will be enough to spark imagination? -- 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]
