Skip to content

Commit

Permalink
fix(clickhouse): Fix clickhouse strings (#1680)
Browse files Browse the repository at this point in the history
* fix(clickhouse): fix strings from json

* cache is back
  • Loading branch information
jdenquin authored Feb 8, 2024
1 parent 4b738f9 commit 5c4bcaa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def change
transaction_id,
toDateTime64(timestamp, 3) as timestamp,
code,
cast(JSONExtractKeysAndValuesRaw(properties), 'Map(String, String)') as properties
JSONExtract(properties, 'Map(String, String)') as properties
FROM events_raw_queue
SQL

Expand Down
4 changes: 2 additions & 2 deletions db/clickhouse_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
end

# TABLE: events_raw_mv
# SQL: CREATE MATERIALIZED VIEW default.events_raw_mv TO default.events_raw ( `organization_id` String, `external_customer_id` String, `external_subscription_id` String, `transaction_id` String, `timestamp` DateTime64(3), `code` String, `properties` Map(String, String) ) AS SELECT organization_id, external_customer_id, external_subscription_id, transaction_id, toDateTime64(timestamp, 3) AS timestamp, code, CAST(JSONExtractKeysAndValuesRaw(properties), 'Map(String, String)') AS properties FROM default.events_raw_queue
create_table "events_raw_mv", view: true, materialized: true, id: false, as: "SELECT organization_id, external_customer_id, external_subscription_id, transaction_id, toDateTime64(timestamp, 3) AS timestamp, code, CAST(JSONExtractKeysAndValuesRaw(properties), 'Map(String, String)') AS properties FROM default.events_raw_queue", force: :cascade do |t|
# SQL: CREATE MATERIALIZED VIEW default.events_raw_mv TO default.events_raw ( `organization_id` String, `external_customer_id` String, `external_subscription_id` String, `transaction_id` String, `timestamp` DateTime64(3), `code` String, `properties` Map(String, String) ) AS SELECT organization_id, external_customer_id, external_subscription_id, transaction_id, toDateTime64(timestamp, 3) AS timestamp, code, JSONExtract(properties, 'Map(String, String)') AS properties FROM default.events_raw_queue
create_table "events_raw_mv", view: true, materialized: true, id: false, as: "SELECT organization_id, external_customer_id, external_subscription_id, transaction_id, toDateTime64(timestamp, 3) AS timestamp, code, JSONExtract(properties, 'Map(String, String)') AS properties FROM default.events_raw_queue", force: :cascade do |t|
end

end

0 comments on commit 5c4bcaa

Please sign in to comment.