1、概述
doris-v2.0.2关联查询预期是得到8条数据,实际只能得到一条数据。
使用where条件过滤时,出现了条件筛选语句失效问题。符合条件的数据也被筛除掉了。
selectdb2.0.2,selectdb cloud没有该问题!!!
2、具体问题
2.1、关联查询情况
select req.rk, req.req_time ,rsp.rsp_code , rsp.component as rspcomponent, req.component as reqcomponent
from t_req_detail as req
left join t_rsp_detail rsp on req.trace_id = rsp.trace_id
-- and req.component <> rsp.component
where 1=1
-- and req.component <> rsp.component
and req.component = rsp.component
and req.mobile = '13500100020';
2.2、为什么开源和商业发行版不一样呢?
两者的合并策略是怎样的?商业发行版修复BUG不同步给开源版本?开源版本的BUG是否会带进商业版本?
3、具体数据
t_req_detail表数据情况:
主键为unique key (“trace_id”,“rk”,“component”,“req_time”)
前缀索引为"trace_id"
PARTITION BY RANGE(req_time
) ()
DISTRIBUTED BY HASH(component
), HASH(trace_id
)
PROPERTIES
(
“dynamic_partition.enable” = “true”,
“dynamic_partition.time_unit” = “DAY”,
mobile 、req_content都带了倒排索引
t_rsp_detail表数据情况:
主键为unique key (“trace_id”,“rk”,“component”,“rsp_time”)
前缀索引为"trace_id"
PARTITION BY RANGE(
rsp_time
) ()DISTRIBUTED BY HASH(
component
), HASH(trace_id
)PROPERTIES
(
“dynamic_partition.enable” = “true”,
“dynamic_partition.time_unit” = “DAY”,
数据结构
{
"select * from t_req_detail where mobile match_all '13349000000'": [
{
"trace_id" : "0057841649",
"rk" : 864691128455220939,
"component" : "柜台调度",
"req_time" : "2023-11-22 14:06:18",
"cluster_name" : "东莞",
"host_name" : "TEST",
"http_path" : "420519",
"ms_name" : "柜台调度",
"ms_method" : "420519",
"pkg" : "undefined",
"mobile" : "13349000000"
},
{
"trace_id" : "0057842029",
"rk" : 5188146770730899183,
"component" : "柜台调度",
"req_time" : "2023-11-22 14:11:20",
"cluster_name" : "东莞",
"host_name" : "TEST",
"http_path" : "420503",
"ms_name" : "柜台调度",
"ms_method" : "420503",
"pkg" : "undefined",
"mobile" : "13349000000"
},
{
"trace_id" : "0057842039",
"rk" : 7782220156096304889,
"component" : "柜台调度",
"req_time" : "2023-11-22 14:11:29",
"cluster_name" : "东莞",
"host_name" : "TEST",
"http_path" : "420531",
"ms_name" : "柜台调度",
"ms_method" : "420531",
"pkg" : "undefined",
"mobile" : "13349000000"
},
{
"trace_id" : "0057842054",
"rk" : 87816,
"component" : "柜台调度",
"req_time" : "2023-11-22 14:11:37",
"cluster_name" : "东莞",
"host_name" : "TEST",
"http_path" : "420503",
"ms_name" : "柜台调度",
"ms_method" : "420503",
"pkg" : "undefined",
"mobile" : "13349000000"
}
]}