From 99d58ff9c3060e72940814714c586e11a72a95ed Mon Sep 17 00:00:00 2001 From: Guillem Borrell Date: Tue, 17 Jan 2023 17:54:48 +0000 Subject: [PATCH] Don't sink parquet for he moment --- src/io.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/io.rs b/src/io.rs index 2afa724..a6edc9b 100644 --- a/src/io.rs +++ b/src/io.rs @@ -77,7 +77,8 @@ pub fn dump_csv_to_stdout(ldf: LazyFrame) { } /// Write a Polars DataFrame to Parquet -pub fn write_parquet(ldf: LazyFrame, path: String) { +/// Not yet supported in standard executor +pub fn sink_parquet(ldf: LazyFrame, path: String) { // Selected compression not implemented yet let mut p = PathBuf::new(); p.push(path); @@ -93,3 +94,11 @@ pub fn write_parquet(ldf: LazyFrame, path: String) { ) .expect("Could not save"); } + +pub fn write_parquet(ldf: LazyFrame, path: String) { + // Selected compression not implemented yet + let mut file = std::fs::File::create(path).unwrap(); + ParquetWriter::new(&mut file) + .finish(&mut ldf.collect().expect("Could not collect")) + .unwrap(); +}