做接口平台,将 hive sql放在shell里,用
hive -e "'
select xxx, concat_ws(",",collect_set(字段)) 字段 from tablexxx;
"
报 FAILED: ParseException line cannot recognize input near ',' ',' 'collect_set' in function specification
处理方式如下:
1 将","修改成 ','
hive -e "'
select xxx, concat_ws(',',collect_set(字段)) 字段 from tablexxx;
"
2 将上面sql原封不动的帖到 xxx.hql中,后用
hive -f xxx.hql 执行
本文介绍了一种在使用Hive SQL时遇到的语法错误及其解决办法。具体来说,当尝试执行包含concat_ws和collect_set函数的SQL语句时遇到了ParseException。通过调整逗号的格式和将SQL语句保存到文件中再执行两种方式解决了该问题。
602

被折叠的 条评论
为什么被折叠?



