23 lines
789 B
Plaintext
23 lines
789 B
Plaintext
DESCRIPTION >
|
|
Hourly aggregates with native JSON data type for properties.
|
|
Allows multi-property GROUP BY at query time via properties.field syntax.
|
|
Uses MergeTree (not AggregatingMergeTree) to preserve distinct property
|
|
combinations — the MV pipe's GROUP BY handles pre-aggregation at insert
|
|
time, and query-time sum() in the pipes handles the final rollup.
|
|
|
|
SCHEMA >
|
|
`org_id` String,
|
|
`env` String,
|
|
`customer_id` String,
|
|
`event_name` String,
|
|
`entity_id` String DEFAULT '',
|
|
`internal_product_id` Nullable(String),
|
|
`hour` DateTime,
|
|
`properties` JSON,
|
|
`total_value` Float64,
|
|
`event_count` UInt64
|
|
|
|
ENGINE "MergeTree"
|
|
ENGINE_PARTITION_KEY "toYYYYMM(hour)"
|
|
ENGINE_SORTING_KEY "org_id, env, hour, customer_id, entity_id, event_name"
|