Repository navigation
Conversation
9775384 to
e0b3f64
Compare
|
Integration test errors look irrelevant. |
There was a problem hiding this comment.
This flag looks a bit foreign for ASTWithAlias member. Maybe we can store flags separately? For example build mapping from ast pointer to bool in QueryNormalizer, save it in visitor's data, and perform lookup in removeUnusedAliasesFromWithClause.
There was a problem hiding this comment.
Hmm, we have to record this used flag inside ASTWithAlias. Because there are many places that analysis/normalize the query ast multiple times. Further analysis will remove used with elements because they are already expanded and are not considered as used anymore.
There was a problem hiding this comment.
So, we will delete more than actually need or do not delete unused?
There was a problem hiding this comment.
we will delete more than actually need because we cannot tell whether it's expanded or really unused.
There was a problem hiding this comment.
Do we need also call removeUnusedAliasesFromWithClause in TreeRewriter::analyze after normalize ?
There was a problem hiding this comment.
Nope, it's for ASTSelect WITH clause exclusively.
|
Desided to postpone due to finding cleaner solution |
|
@amosbird Error |
Interesting. Let's find out why it removes the alias. |
|
ya.make failure is not related to this PR |
|
Intergration tests look weird. |
50063fa to
bc96c5f
Compare
|
Need to merge with master. |
|
Sorry for delay, lost last commit with real fix. I've resolved conflicts, rebased on master. Let's look at tests. |
|
Let's close it in favor of #23194. |
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Cache scalar subqueries during query analysis. This should fix #21067
Detailed description / Documentation draft:
.