tustvold commented on code in PR #1558:
URL: https://github.com/apache/arrow-rs/pull/1558#discussion_r849437690
##########
parquet/src/arrow/arrow_reader.rs:
##########
@@ -154,14 +175,41 @@ impl ArrowReader for ParquetFileArrowReader {
}
impl ParquetFileArrowReader {
+ /// Create a new [`ParquetFileArrowReader`]
pub fn new(file_reader: Arc<dyn FileReader>) -> Self {
- Self { file_reader }
+ Self {
+ file_reader,
+ options: Default::default(),
+ }
+ }
+
+ /// Create a new [`ParquetFileArrowReader`] with the provided
[`ArrowReaderOptions`]
+ pub fn new_with_options(
+ file_reader: Arc<dyn FileReader>,
+ options: ArrowReaderOptions,
+ ) -> Self {
+ Self {
+ file_reader,
+ options,
+ }
}
- // Expose the reader metadata
+ /// Expose the reader metadata
pub fn get_metadata(&mut self) -> ParquetMetaData {
self.file_reader.metadata().clone()
}
+
+ /// Returns the key value metadata, returns `None` if
[`ArrowReaderOptions::skip_arrow_metadata`]
+ fn get_kv_metadata(&self) -> Option<&Vec<KeyValue>> {
+ if self.options.skip_arrow_metadata {
+ return None;
Review Comment:
This can't be written without the change in #1556 to move away from
`&Option<T>`
--
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]