This commit is contained in:
wuaho 2021-09-23 12:34:38 +08:00
parent 8ae3568c15
commit d361aba1a0

View File

@ -1,51 +1,61 @@
drop table if exists debug.event; -- auto-generated definition
create table debug.event create table event
( (
`#ip` Nullable(IPv4), `#ip` Nullable(IPv4),
`#country` Nullable(String), `#country` Nullable(String),
`#country_code` Nullable(String), `#province` Nullable(String),
`#province` Nullable(String), `#city` Nullable(String),
`#city` Nullable(String), `#os` Nullable(String),
`#os_version` Nullable(String), `#device_id` Nullable(String),
`#manufacturer` Nullable(String), `#screen_height` Nullable(UInt16),
`#os` Nullable(String), `#screen_width` Nullable(UInt16),
`#device_id` Nullable(String), `#device_model` Nullable(String),
`#screen_height` Nullable(UInt16), `#app_version` Nullable(String),
`#screen_width` Nullable(UInt16), `#bundle_id` Nullable(String),
`#device_model` Nullable(String), `#app_name` Nullable(String),
`#app_version` Nullable(String), `#game_version` Nullable(String),
`#bundle_id` Nullable(String), `#os_version` Nullable(String),
`#lib` Nullable(String), `#network_type` Nullable(String),
`#lib_version` Nullable(String), `#carrier` Nullable(String),
`#network_type` Nullable(String), `#manufacturer` Nullable(String),
`#carrier` Nullable(String), `#app_id` Nullable(String),
`#browser` Nullable(String), `#account_id` String,
`#browser_version` Nullable(String), `#distinct_id` Nullable(String),
`#duration` Nullable(String), binduid Nullable(String),
`#url` Nullable(String), channel Nullable(String),
`#url_path` Nullable(String), owner_name String default '',
`#referrer` Nullable(String), role_name Nullable(String),
`#referrer_host` Nullable(String), exp Nullable(UInt64),
`#title` Nullable(String), zhanli Nullable(UInt64),
`#screen_name` Nullable(String), maxmapid Nullable(UInt16),
`#element_id` Nullable(String), mapid Nullable(UInt16),
`#element_type` Nullable(String), ghid Nullable(String),
`#resume_from_background` Nullable(String), rmbmoney Nullable(UInt64),
`#element_selector` Nullable(String), jinbi Nullable(UInt64),
`#element_position` Nullable(String), svrindex Nullable(String),
`#element_content` Nullable(String), lv Nullable(UInt16),
`#scene` Nullable(String), vip Nullable(UInt16),
`#mp_platform` Nullable(String), game Nullable(String),
`#app_crashed_reason` Nullable(String),
`#zone_offset` Int8 default 8, `#zone_offset` Int8 default 8,
`#event_id` String, `#event_time` DateTime('UTC'),
`#event_name` String,
`#server_time` DateTime('UTC') default now(),
unitPrice Nullable(UInt16),
money Nullable(String),
islishishouci Nullable(UInt8),
isdangrishouci Nullable(UInt8),
is_today_reg Nullable(UInt8),
orderid Nullable(String),
proid Nullable(String),
step_id Nullable(UInt16),
step_group Nullable(UInt16),
guide_start_time Nullable(DateTime('UTC')),
online_ts Nullable(UInt16),
`#time` Nullable(DateTime('UTC'))
)
engine = ReplacingMergeTree PARTITION BY toYYYYMMDD(`#event_time`)
ORDER BY (owner_name, `#event_name`, `#event_time`, `#account_id`)
SETTINGS index_granularity = 8192;
`#event_time` DateTime('UTC'),
`#account_id` String,
`#distinct_id` Nullable(String),
`#event_name` String,
`#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)