Skip to content

Commit 34209f6

Browse files
igorvoltaicgraciegoheenb-per
authored
feat: add clickhouse and greenplum support (#460)
Co-authored-by: Grace Goheen <[email protected]> Co-authored-by: Benoit Perigaud <[email protected]>
1 parent eaf8386 commit 34209f6

35 files changed

+169
-76
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ Currently, the following adapters are supported:
2222
- DuckDB
2323
- Trino (tested with Iceberg connector)
2424
- AWS Athena (tested manually)
25+
- Greenplum (tested manually)
26+
- ClickHouse (tested manually)
2527

2628
## Using This Package
2729

2830
### Cloning via dbt Package Hub
2931

3032
Check [dbt Hub](https://hub.getdbt.com/dbt-labs/dbt_project_evaluator/latest/) for the latest installation instructions, or [read the docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages.
3133

32-
### Additional setup for Databricks/Spark/DuckDB
34+
### Additional setup for Databricks/Spark/DuckDB/Redshift/ClickHouse
3335

3436
In your `dbt_project.yml`, add the following config:
3537

dbt_project.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ models:
3333
+materialized: "{{ 'table' if target.type in ['bigquery', 'redshift', 'databricks'] else 'view' }}"
3434
int_all_dag_relationships:
3535
# required for BigQuery, Redshift, and Databricks for performance/memory reasons
36-
+materialized: "{{ 'table' if target.type in ['bigquery', 'redshift', 'databricks'] else 'view' }}"
36+
+materialized: "{{ 'table' if target.type in ['bigquery', 'redshift', 'databricks', 'clickhouse'] else 'view' }}"
3737
dag:
3838
+materialized: table
3939
staging:
@@ -86,7 +86,7 @@ vars:
8686

8787
# -- Execution variables --
8888
insert_batch_size: "{{ 500 if target.type in ['athena', 'bigquery'] else 10000 }}"
89-
max_depth_dag: "{{ 9 if target.type in ['bigquery', 'spark', 'databricks'] else 4 if target.type in ['athena', 'trino'] else -1 }}"
89+
max_depth_dag: "{{ 9 if target.type in ['bigquery', 'spark', 'databricks'] else 4 if target.type in ['athena', 'trino', 'clickhouse'] else -1 }}"
9090

9191
# -- Code complexity variables --
9292
comment_chars: ["--"]

docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Currently, the following adapters are supported:
2323
- DuckDB
2424
- Trino (tested with Iceberg connector)
2525
- AWS Athena (tested manually)
26+
- Greenplum (tested manually)
27+
- ClickHouse (tested manually)
2628

2729
## Using This Package
2830

integration_tests/ci/sample.profiles.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,13 @@ integration_tests:
7272
threads: 5
7373
session_properties:
7474
query_max_stage_count: 275
75+
76+
clickhouse:
77+
type: clickhouse
78+
host: "{{ env_var('CLICKHOUSE_TEST_HOST') }}"
79+
port: "{{ env_var('CLICKHOUSE_TEST_PORT') | as_number }}"
80+
user: "{{ env_var('CLICKHOUSE_TEST_USER') }}"
81+
password: "{{ env_var('CLICKHOUSE_TEST_PASS') }}"
82+
dbname: "{{ env_var('CLICKHOUSE_TEST_DBNAME') }}"
83+
schema: dbt_project_evaluator_integration_tests_clickhouse
84+
threads: 5

integration_tests/exclude_package/models/staging/_models.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ models:
66
enforced: true
77
columns:
88
- name: id
9-
data_type: integer
9+
data_type: "{{ 'UInt8' if target.type in ['clickhouse'] else 'integer' }}"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
-- {{ source('fake_source', 'fake_source') }}
2-
select 1 as id
2+
select 1 as id

integration_tests/models/marts/intermediate/_dim_model_7.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ models:
55
enforced: true
66
columns:
77
- name: id
8-
data_type: int
8+
data_type: "{{ 'UInt8' if target.type in ['clickhouse'] else 'int' }}"
99
constraints:
1010
- type: not_null
1111
tests:

integration_tests/models/marts/intermediate/dim_model_7.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
)
66
}}
77

8+
-- {{ ref('int_model_5') }}
89
select * from {{ ref('stg_model_4') }}
9-
-- {{ ref('int_model_5') }}

integration_tests/models/reports/reports.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ models:
2020
enforced: true
2121
columns:
2222
- name: id
23-
data_type: integer
23+
data_type: "{{ 'UInt8' if target.type in ['clickhouse'] else 'integer' }}"

integration_tests_2/ci/sample.profiles.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,14 @@ integration_tests:
5454
host: "{{ env_var('DATABRICKS_TEST_HOST') }}"
5555
http_path: "{{ env_var('DATABRICKS_TEST_HTTP_PATH') }}"
5656
token: "{{ env_var('DATABRICKS_TEST_ACCESS_TOKEN') }}"
57-
threads: 10
57+
threads: 10
58+
59+
clickhouse:
60+
type: clickhouse
61+
host: "{{ env_var('CLICKHOUSE_TEST_HOST') }}"
62+
port: "{{ env_var('CLICKHOUSE_TEST_PORT') | as_number }}"
63+
user: "{{ env_var('CLICKHOUSE_TEST_USER') }}"
64+
password: "{{ env_var('CLICKHOUSE_TEST_PASS') }}"
65+
dbname: "{{ env_var('CLICKHOUSE_TEST_DBNAME') }}"
66+
schema: dbt_project_evaluator_integration_tests_clickhouse
67+
threads: 5

0 commit comments

Comments
 (0)