ClickHouse / ClickHouse/dbt-clickhouse

Unnecessary Setting added

Open
#372 17 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
362
Forks
177
Avg merge
2d 10h
Merged PRs (30d)
8

Description

### Describe the bug
An unnecessary setting `replicated_deduplication_window=0` is added to all tables created using DBT:

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

select 1
```

and result is:
```sql
-- 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
```sql
/* {"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
* dbt version: 1.8.8
* dbt-clickhouse version: 1.8.4
* clickhouse-driver version: 0.2.9
* Python version: 3.11.9
* Operating system: Debian 12 (on docker)
* We are not using Clickhouse Keeper\ZooKeeper or any distributed DDL

Contributor guide

Open the contributing guide

Research direction

Reproduce the dbt 1.8.8 example against ClickHouse and inspect how the dbt-clickhouse adapter assembles CREATE TABLE SQL and SETTINGS clauses. Confirm the generated SQL adds replicated_deduplication_window=0 despite no Keeper, ZooKeeper, or distributed DDL configuration. Done means tables are created without that setting and relevant regression coverage verifies the SQL.

Written by the indexing model from the issue text.

Assessment

Tech stack
clickhouse, python
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.