So I was able to save some struct to Parquet file using the following code:
pub fn store(data: Vec<Data>) -> () {
let json = serde_json::to_string(&data).unwrap();
let cursor = Cursor::new(json);
let mut df: DataFrame = JsonReader::new(cursor)
.finish()
.unwrap();
let mut buffer = File::create("foo.txt").unwrap();
let pw = ParquetWriter::new(buffer);
pw.finish(&mut df);
println!("{:?}", df)
}
I was wondering if there is a way to partition based on columns? This feature is supported in pandas, you can find the documentation here where it is possible to pass partition_cols
when calling the to_parquet
function
Is this feature supported in polars?