Skip to content

Commit

Permalink
chore(analytics): SDK table schema changes (#6579)
Browse files Browse the repository at this point in the history
Co-authored-by: Sandeep Kumar <[email protected]>
  • Loading branch information
ShivanshMathurJuspay and tsdk02 authored Dec 17, 2024
1 parent c883aa5 commit a056dc7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions crates/analytics/docs/clickhouse/scripts/sdk_events.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CREATE TABLE sdk_events_queue (
`event_name` LowCardinality(Nullable(String)),
`first_event` LowCardinality(Nullable(String)),
`latency` Nullable(UInt32),
`timestamp` String,
`timestamp` DateTime64(3),
`browser_name` LowCardinality(Nullable(String)),
`browser_version` Nullable(String),
`platform` LowCardinality(Nullable(String)),
Expand Down Expand Up @@ -115,7 +115,8 @@ CREATE TABLE sdk_events_audit (
`remote_ip` Nullable(String),
`log_type` LowCardinality(Nullable(String)),
`event_name` LowCardinality(Nullable(String)),
`first_event` Bool DEFAULT 1,
`first_event` Bool,
`latency` Nullable(UInt32),
`browser_name` LowCardinality(Nullable(String)),
`browser_version` Nullable(String),
`platform` LowCardinality(Nullable(String)),
Expand All @@ -125,10 +126,10 @@ CREATE TABLE sdk_events_audit (
`value` Nullable(String),
`component` LowCardinality(Nullable(String)),
`payment_method` LowCardinality(Nullable(String)),
`payment_experience` LowCardinality(Nullable(String)) DEFAULT '',
`created_at` DateTime64(3) DEFAULT now64() CODEC(T64, LZ4),
`inserted_at` DateTime DEFAULT now() CODEC(T64, LZ4),
`latency` Nullable(UInt32) DEFAULT 0
`payment_experience` LowCardinality(Nullable(String)),
`created_at` DateTime DEFAULT now() CODEC(T64, LZ4),
`created_at_precise` DateTime64(3),
`inserted_at` DateTime DEFAULT now() CODEC(T64, LZ4)
) ENGINE = MergeTree PARTITION BY merchant_id
ORDER BY
(merchant_id, payment_id)
Expand Down Expand Up @@ -156,7 +157,7 @@ WHERE
length(_error) > 0;

CREATE MATERIALIZED VIEW sdk_events_audit_mv TO sdk_events_audit (
`payment_id` Nullable(String),
`payment_id` String,
`merchant_id` String,
`remote_ip` Nullable(String),
`log_type` LowCardinality(Nullable(String)),
Expand Down

0 comments on commit a056dc7

Please sign in to comment.