Added Analyzer, Planner#31796
Merged
kitaisreal merged 105 commits intoClickHouse:masterfrom Oct 25, 2022
Merged
Conversation
Contributor
|
4c8325b to
5949875
Compare
novikd
reviewed
Jan 24, 2022
Member
novikd
left a comment
There was a problem hiding this comment.
Identifiers resolution looks over-complicated. IExpression and IScope interfaces are very complex.
IExpressiondoesn't represent expression, it's a part ofQueryTree, so in my opinion it's better to rename into something likeIQueryNode.- Result of identifier resolution shouldn't be
IExpression.ColumnExpressionseems to be completely unnatural. It's better to return some thing likeResolveEntitywhich may have different implementations depending on what it's referencing. - Usually things similar to query tree do not know anything about how resolution works. It's purpose to keep information about structure, cache resolve result and may be run resolve resolution.
- Usually scopes work is to keep in memory map
id -> resolve entity. Scope hierarchy is intended to help with identifier shadowing. This means resolution is performed as follows: you find the scope to start with, you find the closest scope containing info about the identifier.
Also one query tree node may introduce several scopes. For example,WITH ... SELECT ...probably should create separate scopes for WITH clause and SELECT clause. - It'd be much more easier to read and understand if resolution would be implemented as a visitor of query tree.
5949875 to
d3d4908
Compare
0e6484c to
98b9ad5
Compare
a4bcabe to
3fadf32
Compare
This was referenced Jul 29, 2022
95250f4 to
3e049ac
Compare
a34810a to
f149a4e
Compare
f3784b5 to
9a02d25
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Added new infrastructure for query analysis and planning under
allow_experimental_analyzersetting.