houqp commented on a change in pull request #7666: URL: https://github.com/apache/arrow/pull/7666#discussion_r451273911
########## File path: rust/datafusion/src/datasource/datasource.rs ########## @@ -20,13 +20,13 @@ use std::sync::{Arc, Mutex}; use arrow::datatypes::Schema; +use arrow::record_batch::SendableRecordBatchReader; use crate::error::Result; -use crate::execution::physical_plan::BatchIterator; -/// Returned by implementors of `Table#scan`, this `BatchIterator` is wrapped with +/// Returned by implementors of `Table#scan`, this `SendableRecordBatchReader` is wrapped with /// an `Arc` and `Mutex` so that it can be shared across threads as it is used. -pub type ScanResult = Arc<Mutex<dyn BatchIterator>>; +pub type ScanResult = Arc<Mutex<dyn SendableRecordBatchReader>>; Review comment: Do we still need to wrap it with Arc and Mutex when `SendableRecordBatchReader` already implements Send and Sync? It looks like `ScanResult` can just be an alias to `SendableRecordBatchReader` or `Arc<Mutex<dyn RecordBatchReader>>`? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org