kylebarron commented on issue #1011: URL: https://github.com/apache/datafusion-python/issues/1011#issuecomment-2636906834
The Arrow C Data Interface and the [PyCapsule Interface](https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html) (of which `__arrow_c_stream__` is a part), are synchronous-only. You could in theory create a `RecordBatchIterator` in Rust that under the hood blocks using tokio in each `next()` call, but that will of course be blocking. Alternatively, you can use `RecordBatchStream`. That [holds a DataFusion `RecordBatchStream`](https://github.com/apache/datafusion-python/blob/8b513906315a0749b9f5cd6f34bf259ab4dd1add/src/record_batch.rs#L51), and so it shouldn't pre-collect. However then it's impossible to transfer via FFI to another library because Arrow doesn't define an async FFI protocol. I [added async iteration support](https://github.com/apache/datafusion-python/pull/975) to `RecordBatchStream`, which may help you -- 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-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org