contain nullable columns
CREATE MATERIALIZED VIEW limits
ENGINE = AggregatingMergeTree() PARTITION BY toYYYYMM(timestamp) PRIMARY KEY (timestamp,skin_id) ORDER BY (timestamp,skin_id)
AS select
skin_id
,timestamp
,quantileExactWeighted(.8)(c_price,c_offers) as max
,quantileExactWeighted(0.2)(c_price,c_offers) as min
from states
GROUP BY skin_id, timestamp;
Исходная таблица:
CREATE TABLE states
(
timestamp DateTime,
skin_id Int64,
c_classid Int64,
c_instanceid Int64,
c_price Int32,
c_offers UInt32,
c_market_hash_name String
)
ENGINE = ReplacingMergeTree()
PARTITION BY toYYYYMMDD(timestamp)
ORDER BY (timestamp,c_classid,c_instanceid)
TTL timestamp + INTERVAL 1 MONTH;
и где skin_id в исходной таблице?
Обсуждают сегодня