Hive
Hive 计算数组交并差函数
select
array_intersect(array(1, 2), array(2, 3)) i,
array_union(array(1, 2), array(2, 3)) u,
array_except(array(1, 2), array(2, 3)) e;
SQL 实例:
select
size(t.res) as cnt
from
(
select
array_intersect(
(
select
collect_set(user_id)
from
ecom_kunlun.crm_s_u
where
date = '20220315'
and shop_id = 7571122
and pay_90d > '0'
),
(
select
collect_set(user_