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

Incremental model not add on cluster expression in create table *__dbt_new_data_* #273

Open
oleg-savko opened this issue Apr 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@oleg-savko
Copy link

Subsequence run incremental model with on cluster seems not work currently.
(try to use delete+insert and default)

First run work fine when incremental model create Replicated* table (and table materialization work fine),
but subsequence run model not work, because on_cluster expression not added:

create table `...`.`...__dbt_new_data_43b9d273_5212_4e9e_a0e2_a188153d7878`      
engine = ReplicatedMergeTree('/clickhouse/tables/{uuid}/{shard}', '{replica}')
order by (...)
-- end_of_sql
SETTINGS  replicated_deduplication_window=0
empty
as (...

DB::Exception: Macro 'uuid' and empty arguments of ReplicatedMergeTree are supported only for ON CLUSTER queries with Atomic database engine. Stack trace:

Any suggestions and ideas?

@oleg-savko oleg-savko added the bug Something isn't working label Apr 18, 2024
@oleg-savko
Copy link
Author

oleg-savko commented Apr 18, 2024

Seems problemin this peace of code:

count(distinct _shard_num) > 1 as is_on_cluster

Its not correspond docs and when on cluster work:

if cluster is set in profile, on_cluster_clause now will return cluster info for:

Database creation
View materialization
Distributed materializations
Models with Replicated engines
table and incremental materializations with non-replicated engine will not be affected by cluster setting (model would be created on the connected node only).

In my case I have only one shard/one replica, and in that situation its not invoke on cluster clause for relation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant