matthewmturner commented on a change in pull request #797:
URL: https://github.com/apache/arrow-rs/pull/797#discussion_r716906214



##########
File path: parquet/src/arrow/mod.rs
##########
@@ -79,8 +52,57 @@
 //!     writer.write(&batch).expect("Writing batch");
 //! }
 //! writer.close().unwrap();
+//! ```
+
+//! `WriterProperties` can be used to set several configuration options
+//! ```rust, no_run
+//! use parquet::basic::{ Compression, Encoding };
+//! // File compression
+//! let props = WriterProperties::builder()
+//!     .set_compression(Compression::SNAPPY)
+//!     .build();
+//! // Max row group size compression
+//! let props = WriterProperties::builder()
+//!     .set_max_row_group_size(100)
+//!     .build();
+//! // File encoding
+//! let props = WriterProperties::builder()
+//!     .set_encoding(Encoding::RLE)
+//!     .build();
+//! // Parquet Version
+//! let props = WriterProperties::builder()
+//!     .set_writer_version(WriterVersion::PARQUET_1_0)
+//!     .build();
+//! ```
+//!
+//! # Example of reading parquet file into arrow record batch
+//!
+//! ```rust, no_run
+//! use arrow::record_batch::RecordBatchReader;
+//! use parquet::file::reader::SerializedFileReader;
+//! use parquet::arrow::{ParquetFileArrowReader, ArrowReader};
+//! use std::sync::Arc;
+//! use std::fs::File;
 //!
+//! let file = File::open("data.parquet").unwrap();
+//! let file_reader = SerializedFileReader::new(file).unwrap();

Review comment:
       So the current read example already uses `ParquetFileArrowReader` which 
implements the `ArrowReader` trait 
(https://docs.rs/parquet/5.4.0/parquet/arrow/arrow_reader/struct.ParquetFileArrowReader.html).
  So i think the existing request does what you are looking for.  ill admit i 
found it a little confusing how `ArrowWriter` is a struct but `ArrowReader` is 
a trait.  I naively expected to be able to just use a `ArrowReader` struct to 
read the parquet file back into record batches.




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