MCPcopy Create free account
hub / github.com/apache/datafusion / execute_stream

Function execute_stream

datafusion/physical-plan/src/execution_plan.rs:1277–1292  ·  view source on GitHub ↗
(
    plan: Arc<dyn ExecutionPlan>,
    context: Arc<TaskContext>,
)

Source from the content-addressed store, hash-verified

1275 reason = "Public API that historically takes owned Arcs"
1276)]
1277pub fn execute_stream(
1278 plan: Arc<dyn ExecutionPlan>,
1279 context: Arc<TaskContext>,
1280) -> Result<SendableRecordBatchStream> {
1281 match plan.output_partitioning().partition_count() {
1282 0 => Ok(Box::pin(EmptyRecordBatchStream::new(plan.schema()))),
1283 1 => plan.execute(0, context),
1284 2.. => {
1285 // merge into a single partition
1286 let plan = CoalescePartitionsExec::new(Arc::clone(&plan));
1287 // CoalescePartitionsExec must produce a single partition
1288 assert_eq!(1, plan.properties().output_partitioning().partition_count());
1289 plan.execute(0, context)
1290 }
1291 }
1292}
1293
1294/// Execute the [ExecutionPlan] and collect the results in memory
1295pub async fn collect_partitioned(

Callers 15

parquet_exec_visitorFunction · 0.85
execute_scalar_subqueryFunction · 0.85
collectFunction · 0.85
collect_with_timeoutFunction · 0.85
execute_streamMethod · 0.85
query_yieldsFunction · 0.85
run_queryFunction · 0.85
executeMethod · 0.85
execute_queryMethod · 0.85

Calls 5

newFunction · 0.85
partition_countMethod · 0.80
output_partitioningMethod · 0.45
schemaMethod · 0.45
executeMethod · 0.45

Tested by 1

query_yieldsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…