Commits


Paddy Horan authored and Chao Sun committed 7d377ba8b20
ARROW-8559: [Rust] Consolidate Record Batch reader traits in main arrow crate Most libraries that use `Arrow` are likely to want to define types that produce `RecordBatch`'s. This PR defines the `RecordBatchReader` and `SendableRecordBatchReader` traits and updates other crates (in particular, DataFusion) to use these traits. In short, I think these traits should be defined in the main arrow crate. It was mentioned on the JIRA that we could just use a single trait and allow users to implement `Send`/`Sync` as necessary. The fact the the `schema` method returns a reference counted type makes this hard to do (`Rc` vs `Arc`) so I settled on two different traits. This seemed like the easiest to do in advance of 1.0, maybe we can improve on this. As `next` returns `Arrow`'s error type I added a new variant to allow wrapping external errors once they implement the standard `Error` trait and `Send`, `Sync`. I remove the `PartialEq` and `Clone` bounds on the DataFusion error type as we were only using these in testing (the tests are updated) and it's best to keep the requirements on external implementers as low a possible. Closes #7666 from paddyhoran/reader-reorg Authored-by: Paddy Horan <paddyhoran@hotmail.com> Signed-off-by: Chao Sun <sunchao@apache.org>