You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "xudong963 (via GitHub)" <gi...@apache.org> on 2026/04/07 08:50:58 UTC
[PR] fix: remove interleave panic recovery after Arrow 58.1.0 [datafusion]
xudong963 opened a new pull request, #21436:
URL: https://github.com/apache/datafusion/pull/21436
## Which issue does this PR close?
- Closes #.
## Rationale for this change
`Fix sort merge interleave overflow` (#20922) added a temporary `catch_unwind`
shim around Arrow's `interleave` call because the upstream implementation still
panicked on offset overflow at the time.
Arrow 58.1.0 includes apache/arrow-rs#9549, which returns
`ArrowError::OffsetOverflowError` directly instead of panicking. DataFusion
main now depends on that release, so the panic recovery path is no longer
needed and only broadens the set of failures we might accidentally treat as
recoverable.
## What changes are included in this PR?
- Remove the temporary panic-catching wrapper from
`BatchBuilder::try_interleave_columns`.
- Keep the existing retry logic, but trigger it only from the returned
`OffsetOverflowError`.
- Replace the panic-specific unit tests with a direct error-shape assertion.
## Are these changes tested?
Yes.
- `cargo test -p datafusion-physical-plan sorts::builder -- --nocapture`
- `cargo test -p datafusion-physical-plan sorts:: -- --nocapture`
- `./dev/rust_lint.sh`
## Are there any user-facing changes?
No.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Follow-up: remove interleave panic recovery after Arrow 58.1.0 [datafusion]
Posted by "xudong963 (via GitHub)" <gi...@apache.org>.
xudong963 merged PR #21436:
URL: https://github.com/apache/datafusion/pull/21436
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Follow-up: remove interleave panic recovery after Arrow 58.1.0 [datafusion]
Posted by "xudong963 (via GitHub)" <gi...@apache.org>.
xudong963 commented on PR #21436:
URL: https://github.com/apache/datafusion/pull/21436#issuecomment-4197790927
cc @kosiew given that you have the context for this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Follow-up: remove interleave panic recovery after Arrow 58.1.0 [datafusion]
Posted by "xudong963 (via GitHub)" <gi...@apache.org>.
xudong963 commented on PR #21436:
URL: https://github.com/apache/datafusion/pull/21436#issuecomment-4204269212
Thanks @alamb @kosiew
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Follow-up: remove interleave panic recovery after Arrow 58.1.0 [datafusion]
Posted by "xudong963 (via GitHub)" <gi...@apache.org>.
xudong963 commented on PR #21436:
URL: https://github.com/apache/datafusion/pull/21436#issuecomment-4197763208
针对这个点我补了一次澄清和回归测试:不是所有 error 都会走二分探测,
`retry_interleave` 只会在 `is_offset_overflow(&e)` 为 true,也就是 Arrow
返回 `OffsetOverflowError` 时才减半重试;其他 error 会直接返回。
这次补充了一个测试 `test_retry_interleave_does_not_retry_non_offset_errors`,
验证非 offset overflow 的错误只尝试一次就原样返回。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Follow-up: remove interleave panic recovery after Arrow 58.1.0 [datafusion]
Posted by "kosiew (via GitHub)" <gi...@apache.org>.
kosiew commented on code in PR #21436:
URL: https://github.com/apache/datafusion/pull/21436#discussion_r3045814575
##########
datafusion/physical-plan/src/sorts/builder.rs:
##########
@@ -336,43 +296,21 @@ mod tests {
}
#[test]
- fn test_recover_offset_overflow_from_panic() {
- let error = recover_offset_overflow_from_panic(
- || -> std::result::Result<(), ArrowError> { panic!("offset overflow") },
- )
- .unwrap_err();
-
- assert!(is_offset_overflow(&error));
+ fn test_is_offset_overflow_matches_arrow_error() {
Review Comment:
Would it make sense to move this coverage up a layer and exercise `BatchBuilder::build_record_batch`, or even the sort-preserving merge drain path, using a real `ArrowError::OffsetOverflowError`?
Right now the tests only stub `retry_interleave`, so they might miss regressions if `interleave` starts surfacing the overflow differently again.
##########
datafusion/physical-plan/src/sorts/builder.rs:
##########
@@ -143,7 +141,7 @@ impl BatchBuilder {
.iter()
.map(|(_, batch)| batch.column(column_idx).as_ref())
.collect();
- recover_offset_overflow_from_panic(|| interleave(&arrays, indices))
+ interleave(&arrays, indices).map_err(Into::into)
Review Comment:
Maybe worth adding a short comment here noting that this now relies on Arrow 58.1.0+ returning `OffsetOverflowError` directly.
That would make the cleanup easier to understand in this file, especially since the removed shim was guarding this exact call site.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org