CREATE TABLE `mf_customer_delivery_monitor_org_detail` (
`rpt_date` date NULL COMMENT "日期",
`order_channel_code` varchar(100) NULL COMMENT "订单渠道",
`order_date` date NULL COMMENT "订阅日期",
`region_code` varchar(50) NULL COMMENT "省区code",
`region_name` varchar(100) NULL COMMENT "省区名称",
`material_org_code` varchar(50) NULL COMMENT "物料网点code",
`material_org_name` varchar(100) NULL COMMENT "物料网点名称",
`branch_code` varchar(50) NULL COMMENT "分公司code",
`branch_name` varchar(100) NULL COMMENT "分公司名称",
`customer_code` varchar(50) NULL COMMENT "客户code",
`customer_name` varchar(100) NULL COMMENT "客户名称",
`seller_id` varchar(50) NULL COMMENT "商家id",
`seller_name` varchar(100) NULL COMMENT "商家",
`is_zd` varchar(10) NULL COMMENT "是否参与自动"
) ENGINE=OLAP
DUPLICATE KEY(`rpt_date`, `order_channel_code`)
COMMENT "商家发货监控网点明细表"
PARTITION BY RANGE(`rpt_date`)
(PARTITION p20221102 VALUES [('2022-11-02'), ('2022-11-03')),
PARTITION p20221103 VALUES [('2022-11-03'), ('2022-11-04')),
PARTITION p20221104 VALUES [('2022-11-04'), ('2022-11-05')))
DISTRIBUTED BY HASH(`rpt_date`) BUCKETS 144
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-60",
"dynamic_partition.end" = "7",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "144",
"in_memory" = "false",
"storage_format" = "DEFAULT",
"enable_persistent_index" = "false"
);
replication_num 副本数
dynamic_partition.enable 开启动态分区
dynamic_partition.start 动态分区的开始时间。以当天为基准,根据该参数向过去推算数个粒度的时间,超过该时间范围的分区将会被删除。如果不填写,则默认为Integer.MIN_VALUE即-2147483648。
dynamic_partition.end:动态分区的结束时间。以当天为基准,会根据该参数提前创建数个粒度的分区范围。
dynamic_partition.prefix:动态分区自动创建的分区名前缀。
dynamic_partition.buckets:动态创建的分区所对应的分桶数量。
enable_persistent_index 是否持久化主键索引,同时使用磁盘和内存存储主键索引,避免主键索引占用过大内存空间。取值为 true 或者 false。如果磁盘为固态硬盘 SSD,则建议设置为 true。自 2.3.0 版本起,StarRocks 支持配置该参数。
网友评论