hive -e 出现cannot recognize input nearXXX

做接口平台,将 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 执行

猜你喜欢

转载自chengjianxiaoxue.iteye.com/blog/2292091