This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 5ab23b540d Added tests with are writing into parquet files in memory
for issue #15158 (#15325)
5ab23b540d is described below
commit 5ab23b540d1839560cd3a7ace445e3c7b43f5f23
Author: pranavJibhakate <[email protected]>
AuthorDate: Sat Mar 22 10:24:29 2025 -0400
Added tests with are writing into parquet files in memory for issue #15158
(#15325)
---
datafusion/wasmtest/src/lib.rs | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/datafusion/wasmtest/src/lib.rs b/datafusion/wasmtest/src/lib.rs
index e2ba50beb6..df0d9d6cbf 100644
--- a/datafusion/wasmtest/src/lib.rs
+++ b/datafusion/wasmtest/src/lib.rs
@@ -182,4 +182,29 @@ mod test {
let task_ctx = ctx.task_ctx();
let _ = collect(physical_plan, task_ctx).await.unwrap();
}
+
+ #[wasm_bindgen_test(unsupported = tokio::test)]
+ async fn test_parquet_write() {
+ let schema = Arc::new(Schema::new(vec![
+ Field::new("id", DataType::Int32, false),
+ Field::new("value", DataType::Utf8, false),
+ ]));
+
+ let data: Vec<ArrayRef> = vec![
+ Arc::new(Int32Array::from(vec![1])),
+ Arc::new(StringArray::from(vec!["a"])),
+ ];
+
+ let batch = RecordBatch::try_new(schema.clone(), data).unwrap();
+ let mut buffer = Vec::new();
+ let mut writer = datafusion::parquet::arrow::ArrowWriter::try_new(
+ &mut buffer,
+ schema.clone(),
+ None,
+ )
+ .unwrap();
+
+ writer.write(&batch).unwrap();
+ writer.close().unwrap();
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]