(
plan: Arc<dyn ExecutionPlan>,
work_table: &Arc<WorkTable>,
)
| 386 | } |
| 387 | |
| 388 | fn 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 | |
| 412 | impl Stream for RecursiveQueryStream { |
| 413 | type Item = Result<RecordBatch>; |
no test coverage detected
searching dependent graphs…