Skip to content

table function view#12567

Merged
alexey-milovidov merged 1 commit intoClickHouse:masterfrom
amosbird:fmi
Sep 2, 2020
Merged

table function view#12567
alexey-milovidov merged 1 commit intoClickHouse:masterfrom
amosbird:fmi

Conversation

@amosbird
Copy link
Copy Markdown
Collaborator

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Add table function view which 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.

@robot-clickhouse robot-clickhouse added doc-alert pr-feature Pull request with new product feature labels Jul 17, 2020
@abyss7 abyss7 self-assigned this Jul 21, 2020
@abyss7 abyss7 self-assigned this Aug 11, 2020
Copy link
Copy Markdown
Member

@alexey-milovidov alexey-milovidov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to make code more generic to avoid
name == "view"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just remove this code completely? What will be worse?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very strange...

Copy link
Copy Markdown
Member

@alexey-milovidov alexey-milovidov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@simPod
Copy link
Copy Markdown
Contributor

simPod commented Sep 22, 2020

I read tests but don't very understand what is this good for 🤔

@alexey-milovidov
Copy link
Copy Markdown
Member

It's intended to pass arbitrary query as is to several remote servers via composition of remote/cluster and view functions.

@lelezhan
Copy link
Copy Markdown

lelezhan commented May 7, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature Pull request with new product feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants