-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Analyzer subquery support FINAL #64133
base: master
Are you sure you want to change the base?
Analyzer subquery support FINAL #64133
Conversation
This is an automated comment for commit c684a8f with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page
Successful checks
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Check Fast Test. |
It should be applied only for tables that support FINAL. |
45b5bd8
to
f094ea9
Compare
d3eea87
to
1ff471f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose it's better to implement this feature on resolved query tree. I can store table modifiers in the current scope and apply them when you resolve Join Tree. Such an approach would make more sense.
} | ||
} | ||
|
||
QueryTreeNodes extractAllTableReferences(const QueryTreeNodePtr & tree, bool extract_table_function_nodes, bool extract_identifier_nodes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think extractAllTableReferences
should be used only for resolved query trees. It's better to write a separate function to traverse unresolved trees.
{ | ||
auto table_expression_modifiers = table_node ? table_node->getTableExpressionModifiers() : table_function_node->getTableExpressionModifiers(); | ||
if (!table_expression_modifiers->isFromParentSubquery()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will work incorrectly in the case:
SELECT
FROM (SELECT * FROM x FINAL) SAMPLE 0.1
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Analyzer support FINAL for subqueries. Example:
SELECT id, value FROM (SELECT id, value FROM test_table WHERE id = 0) FINAL
.