Hive的行转列和列转行

版权声明:打个招呼,转载呗! https://blog.csdn.net/weixin_41919236/article/details/84327654

行转列:使用hive的内置函数explode()进行转化。

举例:
select

movie,

category_name

from

movie_info lateral view explode(category) table_tmp as category_name;

列转行:使用 hive 的内置函数 concat_ws() 和 collect_set()进行转换。

猜你喜欢

转载自blog.csdn.net/weixin_41919236/article/details/84327654