ClickHouse / ClickHouse/dbt-clickhouse

dbt test --store-failures only create *audit db in one node

Open
#488 0 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

The dbt test, when applied with --store-failures, only creates the *audit db in one node, ignoring the dbt profiles config `cluster: '{cluster_name}'`.

### Steps to reproduce
1. Create a dbt profile with the cluster config
2. Run dbt test --store-failures.. using the config at one
3. Inspect your clickhouse cluster and check if the *audit db has been created on all nodes

### Expected behaviour

The *audit db should be created on all nodes give the cluster config is specified in the profile

### Code examples, such as models or profile settings
```yaml
data_platform_clickhouse_dbt:
target: prod_raw
outputs:
prod_raw:
type: clickhouse
schema: "{{ 'prod_metrics_' + var('pr_id') if var('pr_id', '') != '' else 'prod_metrics' }}" # Append 'metrics_' only if 'pr_id' is set
host: demo-host
port: 8443
user: USER
password: PWD
secure: true
verify: false
cluster: '{cluster}'
```

`dbt test --profiles-dir=./profiles/prod --vars "{'pr_id': '${{ env.PR_ID }}'}" --store-failures --select state:modified --state ./state --defer`

### Configuration
#### Environment
+ dbt-adapters==1.16.3
+ dbt-common==1.27.1
+ dbt-core==1.10.7
+ dbt-extractor==0.6.0
+ dbt-protos==1.0.348
+ dbt-semantic-interfaces==0.9.0
+ clickhouse-driver==0.2.9
+ dbt-clickhouse==1.8.9
+ dbt-core==1.8.9

#### ClickHouse server
* ClickHouse Server version: 25.5.7

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the `dbt test --store-failures` command with the shown profile and a configured `cluster`, then trace how dbt-clickhouse creates the failure-storage audit database. Compare the database creation behavior with the profile's cluster setting. Done means the `*audit` database is created on every ClickHouse cluster node when that setting is present.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.