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

Function assign_work_table

datafusion/physical-plan/src/recursive_query.rs:388–410  ·  view source on GitHub ↗
(
    plan: Arc<dyn ExecutionPlan>,
    work_table: &Arc<WorkTable>,
)

Source from the content-addressed store, hash-verified

386}
387
388fn assign_work_table(
389 plan: Arc<dyn ExecutionPlan>,
390 work_table: &Arc<WorkTable>,
391) -> Result<Arc<dyn ExecutionPlan>> {
392 let mut work_table_refs = 0;
393 plan.transform_down(|plan| {
394 if let Some(new_plan) =
395 plan.with_new_state(Arc::clone(work_table) as Arc<dyn Any + Send + Sync>)
396 {
397 if work_table_refs > 0 {
398 not_impl_err!(
399 "Multiple recursive references to the same CTE are not supported"
400 )
401 } else {
402 work_table_refs += 1;
403 Ok(Transformed::yes(new_plan))
404 }
405 } else {
406 Ok(Transformed::no(plan))
407 }
408 })
409 .data()
410}
411
412impl Stream for RecursiveQueryStream {
413 type Item = Result<RecordBatch>;

Callers 1

try_newMethod · 0.85

Calls 3

transform_downMethod · 0.80
dataMethod · 0.45
with_new_stateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…