-
Notifications
You must be signed in to change notification settings - Fork 114
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
Support allow_nullable_key config for models #209
Comments
@GonnaMakeYouCry do you use cluster or single server setup? I tried to reproduce with single server and it works fine for me. According to code, |
@simpl1g ============================== 2023-11-20 07:16:20.020996 | e3382018-9d72-4754-870d-b3f1ffe168d1 ==============================
WITH project_active_periods AS SELECT * FROM actual_project_data -- this filter will only be applied on an incremental run
07:16:21.232101 [debug] [Thread-1 ]: dbt_clickhouse adapter: SQL status: OK in 0.30 seconds
...
WITH project_active_periods AS SELECT * FROM actual_project_data -- this filter will only be applied on an incremental run
07:16:22.074887 [debug] [Thread-1 ]: dbt_clickhouse adapter: SQL status: OK in 0.82 seconds
07:16:22.097520 [debug] [Thread-1 ]: dbt_clickhouse adapter: SQL status: OK in 0.02 seconds
...
07:16:22.113751 [debug] [Thread-1 ]: dbt_clickhouse adapter: Error running SQL: /* {"app": "dbt", "dbt_version": "1.4.9", "profile_name": "clickhouse_beta", "target_name": "beta", "node_id": "model.iyno_data_marts.actual_project_data"} */
07:16:22.114606 [debug] [Thread-1 ]: Timing info for model.iyno_data_marts.actual_project_data (execute): 2023-11-20 07:16:20.774855 => 2023-11-20 07:16:22.114509 |
I believe this is a bug with the "legacy" incremental strategy where settings that are supposed to be DDL "Table" settings are used incorrectly in the INSERT statements. I believe this will be fixed in next upcoming patch release. |
Describe the bug
Incorrect behavior of the model when using the setting allow_nullable_key
Steps to reproduce
My dbt model create ETL process by reading the data from PostgresSQL (I use PostgreSQL Engine) and load the data into Clickhouse.
Data Source table in Postgres has a Nullable setting for columns which I use as uniqueKey and partiotionKey (In fact, there are no Null values there)
3.When I run the model againg I have an error
Code: 115. DB::Exception: Setting allow_nullable_key is neither a builtin setting nor started with the prefix 'custom_' registered for user-defined settings. (UNKNOWN_SETTING) (version 23.3.15.29 (official build))
Expected behaviour
Re-running the model should not lead to errors
Code examples, such as models or profile settings
Model conf
{{ config(
order_by='projectId',
engine='MergeTree()',
partition_by='projectId',
materialized='incremental',
settings = {'allow_nullable_key': 1},
unique_key='modelId',
schema='core') }}
dbt and/or ClickHouse server logs
I used this query to watch where the error happened:
select query from system.query_log where exception like '%115. DB::Exception%'
And query result:
/* {"app": "dbt", "dbt_version": "1.4.9", "profile_name": "clickhouse_beta", "target_name": "beta", "node_id": "model.iyno_data_marts.actual_project_data"} */
Configuration
Core:
Your version of dbt-core is out of date!
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation
Plugins:
ClickHouse server
The text was updated successfully, but these errors were encountered: