Skip to content
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

Supported cluster macros inside table function 'cluster' #26913

Merged

Conversation

PolyProgrammist
Copy link
Contributor

@PolyProgrammist PolyProgrammist commented Jul 28, 2021

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):
Supported cluster macros inside table functions 'cluster' and 'clusterAllReplicas'

Detailed description / Documentation draft:

You can do this query:

create table test_db_o on cluster 'test_shard_localhost' (date DateTime, value UInt32) engine=MergeTree() order by date

And it's equivalent with macros (if there is a value 'cluster' -> 'test_shard_localhost' in system.macros):

create table test_db_a on cluster '{cluster}' (date DateTime, value UInt32) engine=MergeTree() order by date

Also you can call table functions cluster and clusterAllReplicas:

select * from cluster('test_shard_localhost', default.test_db_o)

However currently you cannot call it with cluster macros:

select * from cluster('{cluster}', default.test_db_4)`

The query gives an error:

Code: 170, e.displayText() = DB::Exception: Requested cluster '{cluster}' not found

The aim of this task is to allow to use cluster macros for table functions 'cluster' and 'clusterAllReplicas'

@robot-clickhouse robot-clickhouse added doc-alert pr-feature Pull request with new product feature labels Jul 28, 2021
@ianton-ru
Copy link
Contributor

LGTM

@alexey-milovidov
Copy link
Member

Also add it to skip list of fast test: docker/test/fasttest/run.sh or add config there.

@PolyProgrammist PolyProgrammist force-pushed the table-function-cluster-macros branch from 27be2d0 to 918a4e8 Compare July 29, 2021 09:13
alexey-milovidov added a commit that referenced this pull request Jul 29, 2021
Remove unused files that confuse developers #26913
@PolyProgrammist
Copy link
Contributor Author

Thank you.

Also add it to skip list of fast test: docker/test/fasttest/run.sh or add config there.

@alexey-milovidov could you please merge this pull request once you are ok with it?

I consulted with @tavplubix about the failed test 01099_operators_date_and_timestamp and he says it may be flapping.

@tavplubix tavplubix merged commit c18c168 into ClickHouse:master Jul 29, 2021
@sevirov
Copy link
Contributor

sevirov commented Jul 29, 2021

Internal documentation ticket: DOCSUP-12413

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.

7 participants