Skip to content

Remove Sync from SendableRecordBatchStream #1614

@tustvold

Description

@tustvold

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    api changeChanges the API exposed to users of the crateenhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions