table function view#12567
Conversation
alexey-milovidov
left a comment
There was a problem hiding this comment.
I'd like to make code more generic to avoid
name == "view"
src/Parsers/ASTFunction.cpp
Outdated
There was a problem hiding this comment.
Maybe just remove this code completely? What will be worse?
There was a problem hiding this comment.
Maybe just allow to have query as an argument to any function?
And then throw exception on query analysis stage if it's wrong place...
Thus we can avoid having special case for "view" here.
There was a problem hiding this comment.
This looks very strange...
alexey-milovidov
left a comment
There was a problem hiding this comment.
Alexey Milovidov, [02.09.20 15:43]
Ok. About table function view - maybe better to treat query as function argument (put to arguments) rather than special query field in ASTFunction?
Amos Bird, [02.09.20 15:44]
[In reply to Alexey Milovidov]
but that will complex all function visitors...
Alexey Milovidov, [02.09.20 15:44]
Ok, then will keep it as is.
|
I read tests but don't very understand what is this good for 🤔 |
|
It's intended to pass arbitrary query as is to several remote servers via composition of |
|
So when we could use the view function? I tested it, it also executes subquery in view for local shard firstly,then executes remote shard. Compared with distribute table, can it improve the performance of query execution when combining it with clusters function, like WITH CTE subquery |
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):
Add table function
viewwhich turns an subquery into a table object. This helps passing queries around. For instance, it can be used in remote/cluster table functions.Detailed description / Documentation draft:
Document needs update. Nothing special.