Skip to content

Commit

Permalink
test(11344): add memory_limit enforcement test for parquet sink
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedld committed Jul 9, 2024
1 parent 558348e commit eaa5925
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions datafusion/core/tests/memory_limit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit eaa5925

Please sign in to comment.