Skip to content

Conversation

@mkleen
Copy link
Contributor

@mkleen mkleen commented Jan 21, 2026

Which issue does this PR close?

Cleaned-up version of #18806 according to #18806 (review) with:

Rationale for this change

See #18806

What changes are included in this PR?

See #18806

Are these changes tested?

Yes

Are there any user-facing changes?

outer_queries_schema is removed from PlannerContext.

@github-actions github-actions bot added sql SQL Planner logical-expr Logical plan and expressions sqllogictest SQL Logic Tests (.slt) labels Jan 21, 2026
@github-actions github-actions bot removed the sqllogictest SQL Logic Tests (.slt) label Jan 21, 2026
@mkleen mkleen changed the title Plann recursive subquery cleanup feat: Support planning subqueries with OuterReferenceColumn belongs to non-adjacent outer relations Cleanup Jan 21, 2026
Projection: l.a, l.b, l.c, l.d, l.e
SubqueryAlias: l
Projection: lineitem.l_item_id AS a, lineitem.l_description AS b, lineitem.price AS c
Projection: lineitem.l_orderkey AS a, lineitem.l_item_id AS b, lineitem.l_description AS c, lineitem.l_extendedprice AS d, lineitem.price AS e
Copy link
Contributor Author

@mkleen mkleen Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because the lineitem table is extended now.

"o1.o_custkey".to_string(),
"o1.o_orderstatus".to_string(),
"o1.customer_id".to_string(),
"o1.o_totalprice".to_string(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because the order table is extended now.

assert_snapshot!(
err.strip_backtrace(),
@"Error during planning: Source table contains 3 columns but only 2 names given as column alias"
@"Error during planning: Source table contains 5 columns but only 2 names given as column alias"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because the lineitem table is extended now.

])),
"orders" => Ok(Schema::new(vec![
Field::new("order_id", DataType::UInt32, false),
Field::new("o_orderkey", DataType::UInt32, false),
Copy link
Contributor Author

@mkleen mkleen Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These extensions were necessary to get the tests to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logical-expr Logical plan and expressions sql SQL Planner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Supporting planning (binding) Nested correlated subquery error with a depth exceeding 1

2 participants