-
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
DBT table materialisation does not work properly for CH 24.6.2.17 #335
Comments
`{{ config(order_by='_airbyte_extracted_at', engine='MergeTree()', materialized='table') }}
` Attaching the log
...
�[0m10:36:09.084809 [debug] [Thread-1 (]: Database Error in model ringba_data (models/staging/ringba_data.sql)
compiled Code at target/run/inulti/models/staging/ringba_data.sql
compiled Code at target/run/inulti/models/staging/ringba_data.sql |
Describe the bug
Table creation is using incorrect syntax
using dbt 1.8.5 and CH 24.6.2.17 and dbt-clickhouse latest 1.8.1
`{{ config(order_by='_airbyte_extracted_at', engine='MergeTree()', materialized='incremental') }}
here is my dbt code snippet
Here is what gets generated:
create OR replace table
dbt_rytis.
ringba_data__dbt_backup`engine = MergeTree()
order by (_airbyte_extracted_at)
(
WITH rw AS (
SELECT
_airbyte_extracted_at,
JSONExtract(_airbyte_data, 'campaign_id', 'String') AS campaign_id,
JSONExtract(_airbyte_data, 'target_id', 'String') AS target_id,
JSONExtract(_airbyte_data, 'publisher_id', 'String') AS publisher_id,
JSONExtract(_airbyte_data, 'label_id', 'String') AS label_id,
JSONExtract(_airbyte_data, 'calls', 'Int32') AS calls,
JSONExtract(_airbyte_data, 'revenue', 'Float64') AS revenue,
JSONExtract(_airbyte_data, 'converted_calls', 'Int32') AS converted_calls,
JSONExtract(_airbyte_data, 'total_cost', 'Float64') AS total_cost,
JSONExtract(_airbyte_data, 'call_length_in_seconds', 'Int32') AS call_length_in_seconds,
JSONExtract(_airbyte_data, 'rounded_minutes', 'Int32') AS rounded_minutes,
parseDateTimeBestEffort(JSONExtract(_airbyte_data, 'etl_created_at', 'String')) AS etl_created_at,
parseDateTimeBestEffort(JSONExtract(_airbyte_data, 'etl_updated_at', 'String')) AS etl_updated_at
FROM
airbyte_internal.default_raw__stream_ringba_data
)
SELECT
_airbyte_extracted_at,
campaign_id,
target_id,
publisher_id,
label_id,
calls,
revenue,
converted_calls,
total_cost,
call_length_in_seconds,
rounded_minutes,
etl_created_at,
etl_updated_at
FROM rw
ORDER BY _airbyte_extracted_at;
)`
I get an error:xpected one of: list of elements, insert element, COLUMNS matcher, COLUMNS, qualified asterisk, compound identifier, identifier, asterisk. (SYNTAX_ERROR)
If I remove the last parenthesis after ; and the one opening, then the statment works correctly.
I guess there is a new syntax where when creating from as you do not need parenthesis anymore.
The text was updated successfully, but these errors were encountered: