在外部使用 left join 和 inner join 会影响内部窗口函数的结果

为了更快的定位您的问题,请提供以下信息,谢谢
【详述】
在外部使用 left join 和 inner join 会影响 内部开窗函数的逻辑
案例可见使用 inner join 会影响内部 count(1) over(partition by imp_date, el_lm_experiment_id) as exp_uv 的结果 但是不影响 sum(1) over(partition by imp_date, el_lm_experiment_id) as exp_uv2
【背景】无
【业务影响】结果不正确
【是否存算分离】不是
【StarRocks版本】2.5.3
【附件】

SQL:
select
exp_table.imp_date
,exp_table.el_lm_experiment_id
,sum(statistic_table.in_poster_imp_cnt) as in_poster_imp_cnt
,max(exp_uv) as exp_uv
,max(exp_uv2) as exp_uv2
from
(
select
imp_date
, el_lm_experiment_id
, qimei36
, count(1) over(partition by imp_date, el_lm_experiment_id) as exp_uv
, sum(1) over(partition by imp_date, el_lm_experiment_id) as exp_uv2
from
tableA
where
imp_date between 20240311 and 20240312
and el_lm_experiment_id in (‘11397571’,‘11397572’)
)exp_table
inner join
(
select
imp_date
,qimei36
,in_poster_imp_cnt
,in_poster_clck_cnt
from
tableB
where
imp_date between 20240311 and 20240312
and pgid = ‘page_home_channel’
and ztid = ‘100101’
and qimei36 is not null
and qimei36 <> ‘’
)statistic_table
on
exp_table.imp_date = statistic_table.imp_date
and exp_table.qimei36 = statistic_table.qimei36
group by
exp_table.imp_date,exp_table.el_lm_experiment_id