You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unify SQL planning for ORDER BY, HAVING, DISTINCT, etc #10326
select x from foo order by y can is covered by add_missing_columns, by blindly adding columns into the descendant projection node. Another issue is that we should not run add_missing_columns for other SetExprs except SELECT.
In #10234@jonahgao added a more general solution to use the merged schema from the select list and the FROM clause to handle resolving HAVING and set operations
However, both codepaths now exist, which makes for fairly complicated planning process
Describe the solution you'd like
I think that we should handle ORDER BY similarly to HAVING, use the merged schema, add the missing columns directly in the select list, instead of traversing the plan looking for projection node. Their processing logic may be reusable. I agree it might be good to have a broader discussion about this.
Activity
lichuang commentedon Jan 17, 2025
@alamb Is this issue still on going? If so, let me have a try.
alamb commentedon Jan 17, 2025
👋 @lichuang -- I don't know anyone working on it, but maybe @jonahgao knows of something.
THank you!
jonahgao commentedon Jan 17, 2025
I haven't started working on it yet. Feel free to take it. Thanks @lichuang