【详述】测试dict_mapping使用,并且设置了strict_mode为false,执行insert写入报错
ERROR 5025 (HY000): query failed if record not exist in dict table.
【背景】执行SQL
-- 字典表
CREATE TABLE `t_channel_dic` (
`tid` varchar(1000) NOT NULL COMMENT "",
`channelid` varchar(1000) NOT NULL COMMENT "",
`channelname` varchar(1000) NULL COMMENT ""
) ENGINE=OLAP
PRIMARY KEY(`tid`, `channelid`)
COMMENT "channel字典表"
DISTRIBUTED BY HASH(`tid`, `channelid`) BUCKETS 1
PROPERTIES (
"replication_num" = "3",
"in_memory" = "false",
"storage_format" = "DEFAULT",
"enable_persistent_index" = "true",
"replicated_storage" = "true",
"compression" = "LZ4"
);
-- 关联表
CREATE TABLE bi.`t_sdkreport_all_dict` (
`par_dt` date NOT NULL COMMENT "",
`uniqueid` varchar(1000) NOT NULL COMMENT "",
`tid` varchar(1000),
`chn` varchar(1000),
`med` varchar(1000),
`plat` varchar(1000),
`channelname` varchar(1000) AS dict_mapping(
'bi.t_channel_dic',
tid, chn, 'channelname', false
),
`medname` varchar(1000) AS dict_mapping(
'bi.t_channel_dic',
'1', med, 'channelname', false
),
`medname_oversea` varchar(1000) AS dict_mapping(
'bi.t_channel_dic',
'22310', med, 'channelname', false
),
`platname` varchar(1000) AS dict_mapping(
'bi.t_channel_dic',
'2', plat,'channelname', false
)
) ENGINE=OLAP
PRIMARY KEY(`par_dt`, `uniqueid`)
COMMENT "SDK表"
DISTRIBUTED BY HASH(`uniqueid`) BUCKETS 1
PROPERTIES (
"compression" = "LZ4",
"enable_persistent_index" = "true",
"fast_schema_evolution" = "true",
"replicated_storage" = "true",
"replication_num" = "3"
);
-- insert写入
insert into bi.`t_sdkreport_all_dict` (par_dt, uniqueid, tid, chn, med, plat) select par_dt, uniqueid, tid, chn, med, plat from bi.`t_sdkreport_all` limit 10;
ERROR 5025 (HY000): query failed if record not exist in dict table.
不是设置了false会读取为NULL值吗?怎么还会报错?
【业务影响】
【是否存算分离】否
【StarRocks版本】例如: 3.3.3-312ed45
【集群规模】例如:3fe(1 follower+2observer)+3be(fe与be混部)
【机器信息】CPU虚拟核/内存/网卡,例如:48C/64G/万兆
【联系方式】
【附件】