ClickHouse / dbt-clickhouse

The Clickhouse plugin for dbt (data build tool)
Apache License 2.0
255 stars 113 forks source link

Unnecessary Setting added #372

Open Shlomixg opened 4 weeks ago

Shlomixg commented 4 weeks ago

Describe the bug

An unnecessary setting replicated_deduplication_window=0 is added to all tables created using DBT:

{{
    config(
        materialized = 'table',
        schema = 'default_schema'
    )
}}

select 1

and result is:

-- default_schema.test_table definition

CREATE TABLE default_schema.test_table
(
    `1` UInt8
)
ENGINE = MergeTree
ORDER BY tuple()
SETTINGS replicated_deduplication_window = 0,
 index_granularity = 8192;

How can I disable it?

Expected behaviour

Create the tables without the setting

dbt and/or ClickHouse server logs

/* {"app": "dbt", "dbt_version": "1.8.8", "profile_name": "default_schema", "target_name": "default_schema", "node_id": "model.ra_dbt.test_table"} */
create table `datricks`.`test_table`
engine = MergeTree()
 order by (tuple())
-- end_of_sql
SETTINGS  replicated_deduplication_window=0
empty
as (
select 1
)

Configuration

Environment

genzgd commented 4 weeks ago

It is necessary in some cases to prevent duplicates. Why do you need to disable it?

Shlomixg commented 4 weeks ago

According to the docs this setting is relevant only to replicated tables on ClickHouse Keeper, which we are not using. I don't want to disable it, just think it's not necessary to add it to each table