You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I create an incremental model, and then add a column which is also added to the unique_key, the model fails to build with the error :
DB::Exception: Missing columns: 'col_3' while processing query: 'SELECT col_1, col_2 FROM dbt_clickhouse_2760_test_schema_change_1721300786653.schema_change_append WHERE (col_1, col_3) NOT IN ((SELECT col_1, col_3 FROM dbt_clickhouse_2760_test_schema_change_1721300786653.schema_change_append__dbt_new_data) AS _subquery18)', required columns: 'col_1' 'col_2' 'col_3', maybe you meant: 'col_1' or 'col_2'. (UNKNOWN_IDENTIFIER) (version 23.6.2.18 (official build))
It seems to be failing when trying to insert the records from the old table that are not in the new_data table.
One way would be to modify the query as indicated :
SELECT col_1, col_2
FROM
dbt_clickhouse_2760_test_schema_change_1721300786653.schema_change_append
WHERE
(
col_1,
col_3 <--- REMOVE THE NEW UNIQUE KEY COLUMN
) NOT IN (
(
SELECT
col_1,
col_3 <--- REMOVE THE NEW UNIQUE KEY COLUMN
FROM
dbt_clickhouse_2760_test_schema_change_1721300786653.schema_change_append__dbt_new_data
) AS _subquery18
)
Do you think this approach is viable/correct?
Additionally: I notice that for schema changes the strategy switches to the legacy approach, is there scope to implement this using delete+insert?
The text was updated successfully, but these errors were encountered:
If I create an incremental model, and then add a column which is also added to the
unique_key
, the model fails to build with the error :It seems to be failing when trying to insert the records from the old table that are not in the
new_data
table.See related PR for unit test that demonstrates the issue: https://github.com/the4thamigo-uk/dbt-clickhouse/pull/1/files
I wonder though, how this could be fixed?
One way would be to modify the query as indicated :
Do you think this approach is viable/correct?
Additionally: I notice that for schema changes the strategy switches to the legacy approach, is there scope to implement this using
delete+insert
?The text was updated successfully, but these errors were encountered: