diff --git a/初始化事件表.sql b/初始化事件表.sql index 7ee49cd..dca07d0 100644 --- a/初始化事件表.sql +++ b/初始化事件表.sql @@ -1,5 +1,5 @@ -drop table if exists xiangsu.event; -create table xiangsu.event +drop table if exists debug.event; +create table debug.event ( `#ip` Nullable(IPv4), `#country` Nullable(String), @@ -44,12 +44,8 @@ create table xiangsu.event `#account_id` String, `#distinct_id` Nullable(String), `#event_name` String, - `#server_time` DateTime('UTC') default now(), - - - `sign` Int8 default 1 - -) ENGINE = CollapsingMergeTree(sign) + `#server_time` DateTime('UTC') default now() +) ENGINE = ReplacingMergeTree() PARTITION BY toYYYYMMDD(`#event_time`) order by (`#event_name`, `#event_time`, `#account_id`) -- TTL event_time + toIntervalDay(365) \ No newline at end of file