with temp as
with temp as
(
select '1001' as id, '商品1,商品2' as name ,'类型1,类型2' as type
union all
select '1002'id,'商品4,商品5,商品6'as name , '类型4,类型5,类型6' as type
) select
id,name,type,val1,category1
from temp
lateral view posexplode(split(name,",")) t as val,val1
lateral view posexplode(split(type,",")) t as category,category1
where val=category