备注:explode(x)和posexplode()均为炸裂函数,区别在于explode炸出一个值,posexplode不仅炸出一个值还附带索引号
举例:
select split(col1,",")[idx] as col1 ,type as col2 from test t lateral view posexplode(split(col2,",")) t1 as idx, type -- idx为list(split(col2,","))中对应的每个索引,另外一个list根据该索引取值,就能做到一一匹配
标签:idx,区别,col2,posexplode,explode,索引,split From: https://www.cnblogs.com/shun7man/p/17586078.html