Skip to content

Commit

Permalink
by default compress parquet with lz4
Browse files Browse the repository at this point in the history
  • Loading branch information
XiangpengHao committed Dec 17, 2024
1 parent 10d929d commit d2ca256
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/query_results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ pub(crate) fn export_to_parquet_inner(query_result: &[RecordBatch]) {
// Create an in-memory buffer to write the parquet data
let mut buf = Vec::new();

// Create a parquet writer
let mut writer = ArrowWriter::try_new(&mut buf, query_result[0].schema(), None)
// Create a parquet writer with LZ4 compression
let props = parquet::file::properties::WriterProperties::builder()
.set_compression(parquet::basic::Compression::LZ4)
.build();

let mut writer = ArrowWriter::try_new(&mut buf, query_result[0].schema(), Some(props))
.expect("Failed to create parquet writer");

// Write the record batch
Expand Down

0 comments on commit d2ca256

Please sign in to comment.