Hive 的collect_set使用详解 https://blog.csdn.net/liyantianmin/article/details/48262109 对于非group by字段,可以用Hive的collect_set函数收集这些字段,返回一个数组: 使用数字下标,可以直接访问数组中的元素: select a,collect_set(b) as bb from t where b<='xxxxxx' group by a 会按照a分组 通过collect_set会把每个a所对应的
1.COALESCE( value1,value2,... ) The COALESCE function returns the fist not NULL value from the list of values. If all the values in the list are NULL, then it returns NULL. Example: COALESCE(NULL,NULL,5,NULL,4) returns 5: coalesce()函数,在处理空值时,'' 和NULL
max 函数 在hive中max函数是一个聚合函数,所以,而且返回值是double ,而且后面必须跟group by ,这个和mysql差异很大 Built-in Aggregate Functions (UDAF) DOUBLEmax(col)Returns the maximum value of the column in the group. mysql 中 Returns the maximum value of expr. MAX() may take a string argume