Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```
- widget_statistics_history.sql
- - hour_timestamp
- - site
- - composite
- - widget_category
- - widget_subnet
- - source_id (subid)
- - source_name (если возможно, попытаться извлечь со словаря по subid, composite)
- - traffic_source
- - traffic_type
- - country
- - device
- - os
- - ip
- - region
- - browser
- - wages sum
- - shows sum
- - real_shows sum
- - clicks_accepted sum
- - clicks_rejected sum
- - agent_ghits_wages sum (для каба)
- - revenue sum (для каба)
- ```
- ### Структура
- Предполагаемая структура новой таблицы
- ```
- CREATE TABLE statistics.widget_statistics_history
- (
- hour_timestamp UInt32,
- composite UInt32,
- site UInt32,
- source_id UInt32 DEFAULT 0,
- source_name String DEFAULT dictGetString('source_names', 'name', tuple(toUInt32(composite), toUInt32(source_id))),
- traffic_source String DEFAULT '',
- traffic_type String DEFAULT 'Direct',
- country UInt32 DEFAULT 0,
- device Enum8('desktop' = 1, 'mobile' = 2, 'tablet' = 3) DEFAULT 'desktop',
- os UInt8 DEFAULT 0,
- browser UInt8 DEFAULT 0,
- wages Int64 DEFAULT 0,
- shows Int32 DEFAULT 0,
- real_shows Int32 DEFAULT 0,
- clicks_accepted Int32 DEFAULT 0,
- clicks_rejected Int32 DEFAULT 0
- )
- ENGINE = SummingMergeTree((wages, shows, real_shows, clicks_accepted, clicks_rejected))
- PARTITION BY toDate(hour_timestamp)
- ORDER BY (hour_timestamp, composite, country, device, os, browser, source_id, source_name, traffic_source, traffic_type);
- ```
Add Comment
Please, Sign In to add comment