【详述】在使用列分区时, 10分钟后自动删除过期分区不生效, 使用时间函数表达式后生效
【背景】按文档配置
【业务影响】
【StarRocks版本】3.1.0-1778465
【集群规模】3fe(1 follower+2observer)+ 3be(3台服务器各一个)
【机器信息】8C/24G/万兆
【联系方式】社区群16-???
【建表语句】
不生效:
CREATE TABLE `mkt_order_benefit` (
`adddate` datetime NOT NULL COMMENT "",
`dt` date NOT NULL COMMENT "",
`id` bigint(20) NULL COMMENT "",
`device_id` varchar(65533) NULL COMMENT "",
`order_id` varchar(65533) NULL COMMENT "",
`buffetticketid` int(11) NULL COMMENT "",
`goodsid` int(11) NULL COMMENT "",
`user_id` varchar(65533) NULL COMMENT "",
`amount` decimal64(18, 4) NULL COMMENT "",
`exchangstate` int(11) NULL COMMENT "",
`m_username` varchar(65533) NULL COMMENT "",
`m_roomid` int(11) NULL COMMENT "",
`m_channel` varchar(65533) NULL COMMENT "",
`m_updatetime` datetime NULL COMMENT "",
`m_searchcode` varchar(65533) NULL COMMENT "",
`m_usercode` varchar(65533) NULL COMMENT "",
`city` varchar(65533) NULL COMMENT "",
`realcity` varchar(65533) NULL COMMENT "",
`ordertypenew` int(11) NULL COMMENT "",
`server_time` datetime NULL COMMENT ""
) ENGINE=OLAP
DUPLICATE KEY(`adddate`)
PARTITION BY (`dt`)
DISTRIBUTED BY HASH(`dt`)
PROPERTIES (
"replication_num" = "3",
"in_memory" = "false",
"enable_persistent_index" = "false",
"replicated_storage" = "true",
"partition_live_number" = "10",
"compression" = "LZ4"
);
生效:
@??? CREATE TABLE `mkt_order_benefit` (
`adddate` datetime NOT NULL COMMENT "",
`dt` date NOT NULL COMMENT "",
`id` bigint(20) NULL COMMENT "",
`device_id` varchar(65533) NULL COMMENT "",
`order_id` varchar(65533) NULL COMMENT "",
`buffetticketid` int(11) NULL COMMENT "",
`goodsid` int(11) NULL COMMENT "",
`user_id` varchar(65533) NULL COMMENT "",
`amount` decimal64(18, 4) NULL COMMENT "",
`exchangstate` int(11) NULL COMMENT "",
`m_username` varchar(65533) NULL COMMENT "",
`m_roomid` int(11) NULL COMMENT "",
`m_channel` varchar(65533) NULL COMMENT "",
`m_updatetime` datetime NULL COMMENT "",
`m_searchcode` varchar(65533) NULL COMMENT "",
`m_usercode` varchar(65533) NULL COMMENT "",
`city` varchar(65533) NULL COMMENT "",
`realcity` varchar(65533) NULL COMMENT "",
`ordertypenew` int(11) NULL COMMENT "",
`server_time` datetime NULL COMMENT ""
) ENGINE=OLAP
DUPLICATE KEY(`adddate`)
PARTITION BY date_trunc('day',`dt`)
DISTRIBUTED BY HASH(`dt`)
PROPERTIES (
"replication_num" = "3",
"in_memory" = "false",
"enable_persistent_index" = "false",
"replicated_storage" = "true",
"partition_live_number" = "10",
"compression" = "LZ4"
);