0

我想传递一个在字符串中包含单引号的配置单元 arg。这会导致 EMR 作业失败并出现以下错误:

sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
Command exiting with ret '255'

所需变量:

-hiveconf "myvar=Today's a great day for a test!"

有任何想法吗?谢谢。

4

1 回答 1

0

尝试:

SET myvar="Today's a great day for a test!";

然后调用它:

SELECT * FROM myTable WHERE test_today=${hiveconf:myvar}

当我尝试时,这对我有用,但是当我尝试时:

SET myvar=Today's a great day for a test! (withoutquotes)

我得到一个错误。希望这可以帮助

于 2013-04-18T18:10:38.427 回答