如何解决从 cmd 运行配置单元,但设置字符串不起作用...+ 循环在字符 ''' 错误处不匹配任何内容
我有以下查询(tester.hql):
DROP TABLE IF EXISTS ${hiveconf:schema}.${hiveconf:company}_${hiveconf:START_DT}_${hiveconf:END_DT}_${hiveconf:tablename};
CREATE TABLE ${hiveconf:schema}.${hiveconf:company}_${hiveconf:START_DT}_${hiveconf:END_DT}_${hiveconf:tablename}
AS
SELECT
company,sum(amount) as total
from table
where date between ${hiveconf:START_DT} and ${hiveconf:END_DT}
group by company
我希望能够使用包含设置的字符串来运行它,所以我这样做:
hive -i <(echo "SET START_DT = '201804';SET END_DT = '201806';SET schema = asia;SET company = amazon;SET tablename = test;") -f tester.hql
但我收到此错误:
Logging initialized using configuration in file:/usr/hdp/current/hive-client/conf/hive-log4j.properties
FAILED: ParseException line 3:50 required (...)+ loop did not match anything at character '''
我怎样才能如我所愿地运行它?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。