Skip to content

Apache DataFusion SQL Query Engine

remove sync constraint of SendableRecordBatchStream (#1884)

doki3c1252d1c35c
diff --git a/ballista/rust/core/src/execution_plans/shuffle_reader.rs b/ballista/rust/core/src/execution_plans/shuffle_reader.rs
index ce44be2142..7505f24118 100644
--- a/ballista/rust/core/src/execution_plans/shuffle_reader.rs
+++ b/ballista/rust/core/src/execution_plans/shuffle_reader.rs
@@ -201,7 +201,7 @@ fn stats_for_partitions(
async fn fetch_partition(
location: &PartitionLocation,
-) -> Result<Pin<Box<dyn RecordBatchStream + Send + Sync>>> {
+) -> Result<Pin<Box<dyn RecordBatchStream + Send>>> {
let metadata = &location.executor_meta;
let partition_id = &location.partition_id;
let mut ballista_client =
diff --git a/ballista/rust/core/src/utils.rs b/ballista/rust/core/src/utils.rs
index b612ddb179..560d459977 100644
--- a/ballista/rust/core/src/utils.rs
+++ b/ballista/rust/core/src/utils.rs
@@ -59,7 +59,7 @@ use futures::{Stream, StreamExt};
/// Stream data to disk in Arrow IPC format
pub async fn write_stream_to_disk(
- stream: &mut Pin<Box<dyn RecordBatchStream + Send + Sync>>,
+ stream: &mut Pin<Box<dyn RecordBatchStream + Send>>,
path: &str,
disk_write_metric: &metrics::Time,
) -> Result<PartitionStats> {
@@ -98,7 +98,7 @@ pub async fn write_stream_to_disk(
}
pub async fn collect_stream(
- stream: &mut Pin<Box<dyn RecordBatchStream + Send + Sync>>,
+ stream: &mut Pin<Box<dyn RecordBatchStream + Send>>,
) -> Result<Vec<RecordBatch>> {
let mut batches = vec![];
while let Some(batch) = stream.next().await {
@@ -310,13 +310,13 @@ impl<T: 'static + AsLogicalPlan> QueryPlanner for BallistaQueryPlanner<T> {
}
pub struct WrappedStream {
- stream: Pin<Box<dyn Stream<Item = ArrowResult<RecordBatch>> + Send + Sync>>,
+ stream: Pin<Box<dyn Stream<Item = ArrowResult<RecordBatch>> + Send>>,
schema: SchemaRef,
}
impl WrappedStream {
pub fn new(
- stream: Pin<Box<dyn Stream<Item = ArrowResult<RecordBatch>> + Send + Sync>>,
+ stream: Pin<Box<dyn Stream<Item = ArrowResult<RecordBatch>> + Send>>,
schema: SchemaRef,
) -> Self {
Self { stream, schema }
diff --git a/datafusion/src/physical_plan/mod.rs b/datafusion/src/physical_plan/mod.rs
index e511df1dee..f2bf23bc63 100644
--- a/datafusion/src/physical_plan/mod.rs
+++ b/datafusion/src/physical_plan/mod.rs
@@ -51,7 +51,7 @@ pub trait RecordBatchStream: Stream<Item = ArrowResult<RecordBatch>> {
}
/// Trait for a stream of record batches.
-pub type SendableRecordBatchStream = Pin<Box<dyn RecordBatchStream + Send + Sync>>;
+pub type SendableRecordBatchStream = Pin<Box<dyn RecordBatchStream + Send>>;
/// EmptyRecordBatchStream can be used to create a RecordBatchStream
/// that will produce no results