CREATE TABLE test.cid_promotion_list ON CLUSTER default(
`ck_store_name` String COMMENT '店铺名称',
`ck_product_id` String COMMENT '产品ID',
`ck_product_name` String COMMENT '产品名称',
`ck_advertiser_id` String COMMENT '账户ID',
`ck_advertiser_name` String COMMENT '账户名称',
`ck_project_id` String COMMENT '项目ID',
`ck_project_name` String COMMENT '项目名称',
`ck_promotion_id` String COMMENT '广告ID',
`ck_promotion_name` String COMMENT '广告名称',
`ck_goods_id` String COMMENT '商品id',
`ck_goods_name` String COMMENT '商品名称',
`ck_cost` Decimal(12, 4) DEFAULT 0 COMMENT '总消耗',
`ck_effective_roi` Decimal(12, 4) COMMENT '总付款ROI',
`ck_turnover_roi` Decimal(12, 4) COMMENT '有效总ROI',
`ck_direct_turnover_roi` String COMMENT '有效直接ROI',
`ck_day_order_roi` String COMMENT '当日成交ROI',
`ck_effective_balance` Decimal(12, 4) DEFAULT 0 COMMENT '总付款金额',
`ck_turnover_balance` Decimal(12, 4) DEFAULT 0 COMMENT '有效总成交金额',
`ck_direct_turnover_balance` Decimal(12, 4) DEFAULT 0 COMMENT '有效直接成交金额',
`ck_day_order_balance` Decimal(12, 4) DEFAULT 0 COMMENT '当日成交金额',
`ck_order_num` Int32 DEFAULT 0 COMMENT '总付款订单量',
`ck_turnover_order_num` Int32 DEFAULT 0 COMMENT '有效总成交订单量',
`ck_direct_turnover_num` Int32 DEFAULT 0 COMMENT '有效直接成交订单量',
`ck_day_order_num` Int32 DEFAULT 0 COMMENT '当日成交订单量',
`ck_click` Int32 DEFAULT 0 COMMENT '点击数',
`ck_show` Int32 DEFAULT 0 COMMENT '展示数',
`ck_ctr` Decimal(12, 4) DEFAULT 0 COMMENT '点击率(%)',
`ck_convert` Int32 DEFAULT 0 COMMENT '转化数',
`ck_avg_convert_cost` Decimal(12, 4) DEFAULT 0 COMMENT '转化成本',
`ck_cpm` Decimal(12, 4) DEFAULT 0 COMMENT 'CPM',
`ck_valid_play` Int32 DEFAULT 0 COMMENT '有效播放数',
`ck_total_play` Int32 DEFAULT 0 COMMENT '播放数',
`ck_play_25_feed_break` Int32 DEFAULT 0 COMMENT '25%进度播放数',
`ck_refund_price` Decimal(12, 4) DEFAULT 0 COMMENT '总退款金额',
`ck_refund_num` Int32 DEFAULT 0 COMMENT '退款订单量',
`pt` Date COMMENT '分区标识',
PRIMARY KEY(ck_store_name,ck_product_id,ck_product_name,ck_advertiser_id,ck_advertiser_name,ck_project_id,ck_project_name,ck_promotion_id,
ck_promotion_name,ck_goods_id,ck_goods_name)
)
ENGINE = ReplicatedReplacingMergeTree
PARTITION BY pt
ORDER BY (ck_store_name,ck_product_id,ck_product_name,ck_advertiser_id,ck_advertiser_name,ck_project_id,ck_project_name,ck_promotion_id,
ck_promotion_name,ck_goods_id,ck_goods_name)
SETTINGS index_granularity = 8192
COMMENT 'cid广告列表数据';
Create table cid_promotion_list_dis on cluster default as cid_promotion_list Engine = Distributed(default, default, cid_promotion_list, cityHash64(ck_promotion_id));