Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Added support for parquet sidecar (#1063)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao authored Jun 10, 2022
1 parent a3f050a commit 5f657aa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/io/parquet/write/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use parquet2::write::WriteOptions as FileWriteOptions;
use crate::datatypes::Schema;
use crate::error::{Error, Result};

use super::{schema::schema_to_metadata_key, to_parquet_schema, WriteOptions};
use super::{schema::schema_to_metadata_key, to_parquet_schema, ThriftFileMetaData, WriteOptions};

/// Attaches [`Schema`] to `key_value_metadata`
pub fn add_arrow_schema(
Expand Down Expand Up @@ -87,4 +87,11 @@ impl<W: Write> FileWriter<W> {
pub fn into_inner(self) -> W {
self.writer.into_inner()
}

/// Returns the underlying writer and [`ThriftFileMetaData`]
/// # Panics
/// This function panics if [`Self::end`] has not yet been called
pub fn into_inner_and_metadata(self) -> (W, ThriftFileMetaData) {
self.writer.into_inner_and_metadata()
}
}
7 changes: 5 additions & 2 deletions src/io/parquet/write/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ pub use parquet2::{
compression::{BrotliLevel, CompressionLevel, CompressionOptions, GzipLevel, ZstdLevel},
encoding::Encoding,
fallible_streaming_iterator,
metadata::{Descriptor, KeyValue, SchemaDescriptor},
metadata::{Descriptor, FileMetaData, KeyValue, SchemaDescriptor, ThriftFileMetaData},
page::{CompressedDataPage, CompressedPage, EncodedPage},
schema::types::{FieldInfo, ParquetType, PhysicalType as ParquetPhysicalType},
write::{compress, Compressor, DynIter, DynStreamingIterator, RowGroupIter, Version},
write::{
compress, write_metadata_sidecar, Compressor, DynIter, DynStreamingIterator, RowGroupIter,
Version,
},
FallibleStreamingIterator,
};

Expand Down

0 comments on commit 5f657aa

Please sign in to comment.