xudong963 commented on code in PR #20922:
URL: https://github.com/apache/datafusion/pull/20922#discussion_r2972685040


##########
datafusion/physical-plan/src/sorts/builder.rs:
##########
@@ -200,3 +229,143 @@ pub(crate) fn try_grow_reservation_to_at_least(
     }
     Ok(())
 }
+
+/// Returns true if the error is an Arrow offset overflow.
+fn is_offset_overflow(e: &DataFusionError) -> bool {
+    matches!(
+        e,
+        DataFusionError::ArrowError(boxed, _)
+            if matches!(boxed.as_ref(), ArrowError::OffsetOverflowError(_))
+    )
+}
+
+fn offset_overflow_error() -> DataFusionError {
+    DataFusionError::ArrowError(Box::new(ArrowError::OffsetOverflowError(0)), 
None)
+}
+
+fn recover_offset_overflow_from_panic<T, F>(f: F) -> Result<T>

Review Comment:
   The panic-catching path is intentionally temporary — once 
https://github.com/apache/arrow-rs/pull/9549 lands in DataFusion, `interleave` 
will return a proper `OffsetOverflowError` instead of panicking, and we can 
remove the `catch_unwind` + message matching entirely. At that point the 
existing `retry_interleave` unit tests will cover the full production path 
without any panic-payload coupling. Adding an expensive end-to-end test for a 
short-lived workaround does not seem worth it.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to