fornwall opened a new pull request, #10300: URL: https://github.com/apache/arrow-rs/pull/10300
**Disclaimer**: Most of this PR description and code was AI generated. I have reviewed the code and think it makes sense. Let me know if I should dig into any detail or do modifications. `FFI_ArrowArrayStream::new` maps every stream error to one of `ENOSYS`/`ENOMEM`/`EIO`/`EINVAL` based solely on the `ArrowError` variant. Producers whose errors carry richer semantics than the variant can express have no way to surface them: an `ADBC` driver wrapping its error in `ArrowError::ExternalError` always lands in the `EINVAL` catch-all, even though the ADBC specification expects `ECANCELED` from `get_next` after a cancelled query. Such producers currently have to vendor the entire unsafe export scaffolding just to change one function. Add `FFI_ArrowArrayStream::new_with_error_code`, which takes the error-code mapping as a closure; `new` keeps the existing variant-based mapping as its default. A mapping that returns `0` for an error is coerced to `EINVAL`, since `0` would signal success and lead the consumer to read the uninitialized out-parameter. -- 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]
