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
SQL: lower ORDER BY on a qualified column after a join (ambiguous names are rejected now) #652
SELECT a.k, b.k FROM a JOIN b ON a.id = b.id ORDER BY b.k used to sort by a.k without any error. The SQL lowering emits the Project above the join with qualifier: None, so its output schema loses each column's source table. The resolver then failed to find b.k by (table, name) and fell back to the first column named k.
Status
#539 makes this fallback safe: it now applies only when exactly one column has that name. Otherwise resolution fails. The query above is now rejected instead of being lowered wrongly.
Follow-up
Make such queries lower correctly. The obstacle is that the IR's Project has a single qualifier for all of its output columns (#573 §4.2.2 relies on this), so a pass-through column cannot keep its own source table. Options:
per-column qualifiers on Project;
resolving ORDER BY against the pre-projection scope in the frontend.
Activity