-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Currently SendableRecordBatchStream imposes Sync constraints.
pub type SendableRecordBatchStream = Pin<Box<dyn RecordBatchStream + Send + Sync>>;
This is unfortunate as not all streams have Sync bounds, furthermore it is unclear why Sync is particularly useful for a stream.
A type is Sync if a reference to it can be shared across multiple threads, as opposed to Send which just requires that it can be sent to another thread. However, you can only poll a stream with a mutable, and therefore exclusive reference. The only thing you can therefore do with a &SendableRecordBatchStream is get the schema which I doubt is being exploited anywhere.
Describe the solution you'd like
Remove the Sync constraint
Describe alternatives you've considered
Keep the sync constraint
Additional context
This constraint currently forces a Mutex in FlightDataStream even though it should be unnecessary - see here