1、concat_ws
代码语言:javascript复制SELECT CONCAT_WS('.',split('a.b.c.d','\.')[0],split('a.b.c.d','\.')[1],split('a.b.c.d','\.')[2]);
2、row_num()
代码语言:javascript复制SELECT a.*
FROM
(
SELECT t.*,row_num()over(partition BY package_name,order BY row) as row_num
from t
) a
WHERE a.row_num=1
3、加载jar包函数
代码语言:javascript复制add jar path/xxxxx.jar;
create temporary function function_name as 'com.company.function_name';
4、中文UTF-8转码
代码语言:javascript复制reflect('java.net.URLDecoder', 'decode',XXXXXX ,"UTF-8")
5、Hive加载数据到表
代码语言:javascript复制load DATA LOCAL inpath ''
overwrite into TABLE table_name;
6、避免科学计数法表示浮点数
cast(column as decimal(a, b))
a表示总的位数,b表示保留几位小数