Skip to content

Commit 0557ce4

Browse files
timsaucerclaude
andcommitted
refactor: thread SubqueryContext explicitly through physical planning
Removes the SessionState.clone() + execution_props_mut() trick used by DefaultPhysicalPlanner to register scalar-subquery state for expression lowering. That side channel relied on stashing per-plan state in ExecutionProps, which forced physical planning to hold a mutable SessionState and blocked moving QueryPlanner / PhysicalPlanner to &dyn Session. Introduces SubqueryContext in datafusion-expr and threads it explicitly through create_initial_plan_inner, task_helper, map_logical_node_to_physical, and the standalone planning helpers. Adds *_with_subquery_context dual entry points for create_physical_expr, create_physical_exprs, create_physical_sort_expr(s), create_window_expr(_with_name), and LoweredAggregateBuilder.with_subquery_context — original public signatures are preserved and delegate with SubqueryContext::default(), so downstream callers are unaffected. Drops the unreleased subquery_indexes and subquery_results fields from ExecutionProps. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dc80bd7 commit 0557ce4

6 files changed

Lines changed: 602 additions & 129 deletions

File tree

0 commit comments

Comments
 (0)