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

Function check_inner_plan

datafusion/expr/src/logical_plan/invariants.rs:275–349  ·  view source on GitHub ↗
(inner_plan: &LogicalPlan)

Source from the content-addressed store, hash-verified

273// Recursively check the unsupported outer references in the sub query plan.
274#[cfg_attr(feature = "recursive_protection", recursive::recursive)]
275fn check_inner_plan(inner_plan: &LogicalPlan) -> Result<()> {
276 // We want to support as many operators as possible inside the correlated subquery
277 match inner_plan {
278 LogicalPlan::Aggregate(_) => {
279 inner_plan.apply_children(|plan| {
280 check_inner_plan(plan)?;
281 Ok(TreeNodeRecursion::Continue)
282 })?;
283 Ok(())
284 }
285 LogicalPlan::Filter(Filter { input, .. }) => check_inner_plan(input),
286 LogicalPlan::Window(window) => {
287 check_mixed_out_refer_in_window(window)?;
288 inner_plan.apply_children(|plan| {
289 check_inner_plan(plan)?;
290 Ok(TreeNodeRecursion::Continue)
291 })?;
292 Ok(())
293 }
294 LogicalPlan::Projection(_)
295 | LogicalPlan::Distinct(_)
296 | LogicalPlan::Sort(_)
297 | LogicalPlan::Union(_)
298 | LogicalPlan::TableScan(_)
299 | LogicalPlan::EmptyRelation(_)
300 | LogicalPlan::Limit(_)
301 | LogicalPlan::Values(_)
302 | LogicalPlan::Subquery(_)
303 | LogicalPlan::SubqueryAlias(_)
304 | LogicalPlan::Unnest(_) => {
305 inner_plan.apply_children(|plan| {
306 check_inner_plan(plan)?;
307 Ok(TreeNodeRecursion::Continue)
308 })?;
309 Ok(())
310 }
311 LogicalPlan::Join(Join {
312 left,
313 right,
314 join_type,
315 ..
316 }) => match join_type {
317 JoinType::Inner => {
318 inner_plan.apply_children(|plan| {
319 check_inner_plan(plan)?;
320 Ok(TreeNodeRecursion::Continue)
321 })?;
322 Ok(())
323 }
324 JoinType::Left
325 | JoinType::LeftSemi
326 | JoinType::LeftAnti
327 | JoinType::LeftMark => {
328 check_inner_plan(left)?;
329 check_no_outer_references(right)
330 }
331 JoinType::Right
332 | JoinType::RightSemi

Callers 2

wont_fail_extension_planFunction · 0.85

Calls 3

apply_childrenMethod · 0.45

Tested by 1

wont_fail_extension_planFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…