摘要: Hive 在 Linux 的 Shell 中的使用 第一种: hive -e "后面直接加一条SQL" hive -e "select * from test1.students limit 10" 第二种: hive -f hql文件路径 将HQL写在一个文件里,再使用 -f 参数指定该文件 编辑 阅读全文
posted @ 2022-02-23 12:49 赤兔胭脂小吕布 阅读(515) 评论(0) 推荐(0) 编辑
摘要: Hive 行转列 lateral view、explode、posexplode explode()方法将数据扁平化 行→列 只能接收array、map 例如select explode(split(words,',')) from words hello,java,hello,java,scala 阅读全文
posted @ 2022-02-23 10:27 赤兔胭脂小吕布 阅读(88) 评论(0) 推荐(0) 编辑
摘要: Hive自定义函数UserDefineFunction 自定义函数只针对当前的 hive shell 有效,一旦退出当前shell,则需要重新注册 分类: UDF:一进一出 UDTF:一进多出 UDAF:多进一出(一般用不到) UDF:一进一出 创建maven项目,并加入依赖 <dependency 阅读全文
posted @ 2022-02-23 00:17 赤兔胭脂小吕布 阅读(69) 评论(0) 推荐(0) 编辑