Clean table alias generation and generate unique aliases up-front #32784
Labels
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-enhancement
Milestone
Table aliases need to be unique in the SQL tree (at least within a given SELECT) Our current table alias management works as follows:
_usedAliases
state that tracks which aliases have already been used._usedAliases
and rewrites aliases recursively inside the clause to make sure they don't conflict.We're now exploring ways to simplify the query tree and its processing, and specifically to get rid of TableReferenceExpression and have ColumnExpression just contain its table alias directly as a string. For this to be feasible, the alias on a table cannot change after its constructed, since a column may already be referencing it via its alias (or more precisely, it can be changed, but then we need to recursively look for column in the tree and change them as well). We also generally want to make things more immutable, as well as remove private state from SelectExpression, making it more like a regular expression.
As a result, we should do the following:
The text was updated successfully, but these errors were encountered: