【发布时间】:2018-10-25 22:46:08
【问题描述】:
我像这样使用 --hiveconf 参数将参数传递给 HIVE 脚本,以将一个值传递给 HIVE 查询。有没有其他方法可以将参数传递给 HIVE 脚本?
beeline -u "${dbconection}" --hiveconf load_id=${loadid} -f /etc/sql/hive_script.sql
hive_script.sql 正在从 table-a 中选择记录并插入 table-b。
INSERT into TABLE table-b
SELECT column1,
Column2,
Column3,
${hiveconf:loadid} as load_id,
Column5
From table-a;
我收到以下错误消息
Error: Failed to open new session: org.apache.hive.service.cli.HiveSQLException: java.lang.IllegalArgumentException: Cannot modify load_id at runtime. It is not in list of params that are allowed to be modified at runtime
这是我的环境中配置单元变量替换的设置。
set hive.variable.substitute;
+--------------------------------+--+
| set |
+--------------------------------+--+
| hive.variable.substitute=true |
+--------------------------------+--+
【问题讨论】: