hive
码上行动、
这个作者很懒,什么都没留下…
展开
-
hive中的窗口函数以及应用
1.sum(col2) over(partition by col1 order by col2) : 通过col1分组对col2累计求和 2.min(col2) over(partition by col1 order by col2) : 通过col1分组对col2累计求每次的最小值 3.max(col2) over(partition by col1 order by col2) : 通过col1分组对col2累计求每次的最大值 4.avg(col2) over(partition原创 2021-07-13 11:26:33 · 253 阅读 · 0 评论 -
在hive中查询结果显示数据库的名称和表名
在/usr/local/hive/conf/hive-site.xml进行添加配置 <property> <name>hive.cli.print.header</name> <value>true</value> <description>Whether to print the names of the columns in query output.</description> <原创 2021-07-12 16:17:45 · 1143 阅读 · 1 评论 -
hive中自定义函数的使用
1.编写自定义类 public class FirstUDF extends UDF { //重写evaluate方法 public String evaluate(String str){ String result=null; if(!StringUtils.isEmpty(str)){ result=str.toUpperCase(); } return result; } } 在pom.xm原创 2021-07-12 12:06:46 · 361 阅读 · 0 评论