From eaa5925c2b250f1f2a95fbb3d3797e06e5e00444 Mon Sep 17 00:00:00 2001 From: wiedld Date: Tue, 9 Jul 2024 16:19:42 -0700 Subject: [PATCH] test(11344): add memory_limit enforcement test for parquet sink --- datafusion/core/tests/memory_limit/mod.rs | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/datafusion/core/tests/memory_limit/mod.rs b/datafusion/core/tests/memory_limit/mod.rs index f61ee5d9ab98..aff6d5b737e1 100644 --- a/datafusion/core/tests/memory_limit/mod.rs +++ b/datafusion/core/tests/memory_limit/mod.rs @@ -323,6 +323,31 @@ async fn oom_recursive_cte() { .await } +#[tokio::test] +async fn oom_parquet_sink() { + let file = tempfile::Builder::new() + .suffix(".parquet") + .tempfile() + .unwrap(); + + TestCase::new() + .with_query(format!( + " + COPY (select * from t) + TO '{}' + STORED AS PARQUET OPTIONS (compression 'uncompressed'); + ", + file.path().to_string_lossy() + )) + .with_expected_errors(vec![ + // TODO: update error handling in ParquetSink + "Unable to send array to writer!", + ]) + .with_memory_limit(200_000) + .run() + .await +} + /// Run the query with the specified memory limit, /// and verifies the expected errors are returned #[derive(Clone, Debug)]