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
I use the following code to create a materialized view to write to a table with ReplicatedReplacingMergeTree engine:
{{ config(
materialized="materialized_view",
engine="ReplicatedReplacingMergeTree('/clickhouse/tables/kafka/mysql_test_users/{uuid}','{replica}',_ts_ms,_deleted)",
order_by="(id)"
) }}
SELECT
JSONExtractString(_key, 'id') AS id,
if(op = 'd',JSONExtractString(before,'name'),JSONExtractString(after,'name')) AS name,
toInt32(if(op = 'd',JSONExtractString(before,'age'),JSONExtractString(after,'age'))) AS age,
if(op = 'd',toDateTime64(JSONExtractString(before,'created_at'),3),
toDateTime64(JSONExtractString(after,'created_at'),3)) AS created_at,
if(op = 'd',toDateTime64(JSONExtractString(before,'updated_at'),3),
toDateTime64(JSONExtractString(after,'updated_at'),3)) AS updated_at,
if(op = 'd',1,0) as _deleted,
ts_ms as _ts_ms
FROM
{{ source('kafka', 'mysql_test_users_json') }}
This will be compiled into a view creation query with on cluster clause, however, I do not want to create a view in the cluster, but the engine of the target table needs on cluster clause, is there any way to create non-clustered materialized views and clustered tables?
The text was updated successfully, but these errors were encountered:
I use the following code to create a materialized view to write to a table with ReplicatedReplacingMergeTree engine:
This will be compiled into a view creation query with on cluster clause, however, I do not want to create a view in the cluster, but the engine of the target table needs on cluster clause, is there any way to create non-clustered materialized views and clustered tables?
The text was updated successfully, but these errors were encountered: