3

I am a bit out of ideas as after doing this

let mut cursor = Cursor::new(Vec::new());
let parquet_bytes = ParquetWriter::new(cursor)
    .with_statistics(true)
    .with_compression(ParquetCompression::Snappy)
    .finish(df)
    .unwrap();

I no longer own cursor to pass to s3 sdk. is there a different way?

andy8203
  • 51
  • 2

1 Answers1

0

Have you tried passing cursor as a mutable reference? Something like this:

    let s3_client = aws_sdk_s3::Client::new();

    let mut df = df!("a" => &[1,2]).unwrap();
    let mut buf = vec![];
   
    ParquetWriter::new(&mut buf).finish(&mut df).unwrap();

    s3_client
        .put_object()
        .bucket("my-bucket-data")
        .key("tmp.parquet")
        .body(buf.into())
        .send()
        .await
        .unwrap();

Jandre Marais
  • 318
  • 2
  • 9