Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(11397): surface proper errors in ParquetSink #11399

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 7 additions & 16 deletions datafusion/core/src/datasource/file_format/parquet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,12 +893,9 @@ async fn send_arrays_to_col_writers(
let mut next_channel = 0;
for (array, field) in rb.columns().iter().zip(schema.fields()) {
for c in compute_leaves(field, array)? {
col_array_channels[next_channel]
.send(c)
.await
.map_err(|_| {
DataFusionError::Internal("Unable to send array to writer!".into())
})?;
// Do not surface error from closed channel.
let _ = col_array_channels[next_channel].send(c).await;

wiedld marked this conversation as resolved.
Show resolved Hide resolved
next_channel += 1;
}
}
Expand Down Expand Up @@ -984,11 +981,8 @@ fn spawn_parquet_parallel_serialization_task(
&pool,
);

serialize_tx.send(finalize_rg_task).await.map_err(|_| {
DataFusionError::Internal(
"Unable to send closed RG to concat task!".into(),
)
})?;
// Do not surface error from closed channel.
let _ = serialize_tx.send(finalize_rg_task).await;

current_rg_rows = 0;
rb = rb.slice(rows_left, rb.num_rows() - rows_left);
Expand All @@ -1013,11 +1007,8 @@ fn spawn_parquet_parallel_serialization_task(
&pool,
);

serialize_tx.send(finalize_rg_task).await.map_err(|_| {
DataFusionError::Internal(
"Unable to send closed RG to concat task!".into(),
)
})?;
// Do not surface any error here due to closed channel.
let _ = serialize_tx.send(finalize_rg_task).await;
}

Ok(())
Expand Down
4 changes: 2 additions & 2 deletions datafusion/core/tests/memory_limit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ async fn oom_parquet_sink() {
path.to_string_lossy()
))
.with_expected_errors(vec![
// TODO: update error handling in ParquetSink
"Unable to send array to writer!",
"Failed to allocate additional",
"for ParquetSink(ArrowColumnWriter)",
])
.with_memory_limit(200_000)
.run()
Expand Down