Apache spark 字符串concat运算符(| |)在配置单元中抛出错误

Apache spark 字符串concat运算符(| |)在配置单元中抛出错误,apache-spark,hadoop,hive,hiveql,Apache Spark,Hadoop,Hive,Hiveql,我试图使用concat运算符| |和抛出错误来concat表中的字符串列 Here is the query: select "Bob"||'~'||"glad" from table its throwing error as : ParseException - cannpt recognize input near '|' '"~"' '|' in expression specification 它与concat函数一起工作

我试图使用concat运算符| |和抛出错误来concat表中的字符串列

Here is the query: select "Bob"||'~'||"glad" from table

its throwing error as : ParseException - cannpt recognize input near '|' '"~"' '|' in expression specification
它与concat函数一起工作,但不与concat运算符一起工作

select concat("bob","~","glad") from table - its working
我使用的是hive 2.1版,有人能告诉我为什么这个操作员不工作吗


谢谢,Babu

配置单元不支持concat操作符及其oracle语法。请使用
concat
函数来计算多个值。您可以使用
concat\u ws
来使用分隔符进行连接。
海螺


嗨,Koushik,谢谢你的快速回复。我正在Hive3.x中使用| |及其工作模式。我正在将代码移动到Hive2.x版本,并面临此问题。我通过shell脚本来执行这个sql语句,您认为shell脚本有问题吗?嗯,很有趣。可能的话,你能看看它生成的最终SQL是什么吗?然后在Hive2.x中启动SQL。如果SQL有效,那么shell就有问题了。如果SQL不起作用,那么看看问题出在哪里-是shell还是SQL。是的,我尝试过,对于连接运算符| |,SQL似乎有问题。所有的文档都说我们可以使用| |进行连接,但在使用时会出现抛出错误。不知道是什么问题。当我把它改为concat_ws时,它工作得很好。你的蜂巢的确切版本是什么?我测试了2.1.1及其工作原理。它是hive 1.2.1000.2.6.1.40-4
select concat ('this','~','is','~','hello','~','world');
Output : this~is~hello~world
select concat_ws ('~','hello','world','is','not','enough');
Output : hello~world~is~not~enough