hive posexplode炸裂函数

hive posexplode炸裂函数_第1张图片

with tmp as (
    select 'A/B' as a, '1/3' as b 
    union all 
    select 'B/C/D' as a, '4/5/2' as b 
) 

select
 a,b,cc,cc2
from (
    select
    a,b,
    pos,cc,
    pos2,cc2
    from tmp 
    lateral view posexplode(split(a,'/'))t2 as pos,cc
    lateral view posexplode(split(b,'/'))t2 as pos2,cc2
) t3
where pos = pos2

 

你可能感兴趣的:(hive,hadoop,数据仓库)