表生成函数:可以理解为一个函数可以生成一个表
行转列函数:
explode(字段名--hive中集合类型中的array,map)----炸开字段内容
distinct去重
select distinct sub from (select explode(subjects) as sub from t_stu_subject) temp;
表生成函数:lateral view
目标表
select id,name,tmp.sub
from t_stu_subject later view wxplode(subjects) tmp as sub;
转载自:https://blog.csdn.net/cs_mycsdn/article/details/82890955