简体   繁体   English

如何从Shell脚本传递路径到Hive外部表?

[英]How to pass path to an Hive external table from shell script?

I am creating an Hive external table via a hiveq.sql script: 我正在通过hiveq.sql脚本创建Hive外部表:

Create external table if not exists abc
(
id string
)
Row format delimited
fields terminated by '|'
Stored as textfile
LOCATION '${hiveconf:loc}/xyz/data';

But i am getting below exception when i am trying to execute it with Shell Script: 但是当我尝试使用Shell脚本执行它时,我遇到了异常:

hive -hiveconf test_loc=/om/name/loc -f hiveq.sql

Exception: 例外:

IllegalArgumentException java.net.URISyntaxException: 
  Relative path in absolute URI: ${hiveconf:test_loc%7D/xyz/data

Please help. 请帮忙。

Typo... :-) 错字... :-)

loc Vs. loc Vs. test_loc


${hiveconf:loc}

-hiveconf test_loc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM