first working cli importer
This commit is contained in:
committed by
Carl-Gerhard Lindesvärd
parent
bf0c14cc88
commit
1b613538cc
@@ -1,39 +1,5 @@
|
||||
CREATE DATABASE IF NOT EXISTS openpanel;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS openpanel.events (
|
||||
`id` UUID DEFAULT generateUUIDv4(),
|
||||
`name` String,
|
||||
`device_id` String,
|
||||
`profile_id` String,
|
||||
`project_id` String,
|
||||
`session_id` String,
|
||||
`path` String,
|
||||
`origin` String,
|
||||
`referrer` String,
|
||||
`referrer_name` String,
|
||||
`referrer_type` String,
|
||||
`duration` UInt64,
|
||||
`properties` Map(String, String),
|
||||
`created_at` DateTime64(3),
|
||||
`country` String,
|
||||
`city` String,
|
||||
`region` String,
|
||||
`longitude` Nullable(Float32),
|
||||
`latitude` Nullable(Float32),
|
||||
`os` String,
|
||||
`os_version` String,
|
||||
`browser` String,
|
||||
`browser_version` String,
|
||||
-- device: mobile/desktop/tablet
|
||||
`device` String,
|
||||
-- brand: (Samsung, OnePlus)
|
||||
`brand` String,
|
||||
-- model: (Samsung Galaxy, iPhone X)
|
||||
`model` String
|
||||
) ENGINE MergeTree
|
||||
ORDER BY
|
||||
(project_id, created_at, profile_id) SETTINGS index_granularity = 8192;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS openpanel.events_v2 (
|
||||
`id` UUID DEFAULT generateUUIDv4(),
|
||||
`name` String,
|
||||
@@ -58,26 +24,17 @@ CREATE TABLE IF NOT EXISTS openpanel.events_v2 (
|
||||
`os_version` String,
|
||||
`browser` String,
|
||||
`browser_version` String,
|
||||
-- device: mobile/desktop/tablet
|
||||
`device` String,
|
||||
-- brand: (Samsung, OnePlus)
|
||||
`brand` String,
|
||||
-- model: (Samsung Galaxy, iPhone X)
|
||||
`model` String
|
||||
) ENGINE = MergeTree() PARTITION BY toYYYYMM(created_at)
|
||||
`model` String,
|
||||
`imported_at` Nullable(DateTime),
|
||||
INDEX idx_name name TYPE bloom_filter GRANULARITY 1,
|
||||
INDEX idx_properties_bounce properties ['__bounce'] TYPE
|
||||
set
|
||||
(3) GRANULARITY 1
|
||||
) ENGINE = MergeTree PARTITION BY toYYYYMM(created_at)
|
||||
ORDER BY
|
||||
(project_id, created_at, profile_id) SETTINGS index_granularity = 8192;
|
||||
|
||||
ALTER TABLE
|
||||
events DROP COLUMN utm_source,
|
||||
DROP COLUMN utm_medium,
|
||||
DROP COLUMN utm_campaign,
|
||||
DROP COLUMN utm_term,
|
||||
DROP COLUMN utm_content,
|
||||
DROP COLUMN sdk,
|
||||
DROP COLUMN sdk_version,
|
||||
DROP COLUMN client_type,
|
||||
DROP COLUMN continent;
|
||||
(project_id, toDate(created_at), profile_id, name) SETTINGS index_granularity = 8192;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS openpanel.events_bots (
|
||||
`id` UUID DEFAULT generateUUIDv4(),
|
||||
|
||||
Reference in New Issue
Block a user