concat_ws 函数
concat_ws 函数在连接字符串的时候,只要有一个字符串不是NULL,就不会返回NULL,concat_ws 函数需要指定分隔符。
hive> select concat_ws('-','a','b');
a-b
hive> select concat_ws('-','a','b',null);
a-b
hive> select concat_ws('','a','b',null);
ab
concat_ws 函数在连接字符串的时候,只要有一个字符串不是NULL,就不会返回NULL,concat_ws 函数需要指定分隔符。
hive> select concat_ws('-','a','b');
a-b
hive> select concat_ws('-','a','b',null);
a-b
hive> select concat_ws('','a','b',null);
ab
本文标题:hive - concat_ws 函数
本文链接:https://www.haomeiwen.com/subject/wrsywhtx.html
网友评论