Impala实践之八:脚本中引号问题

JerryXia 发表于 , 阅读 (24)

结果:

$ bash impala-exec.sh "select distinct dt from tablename" "ip1:21000" "tmp/test.txt"select distinct dt from tablename------tmp/test.txt------ip1:21000Error, could not parse arguments "distinct dt from tablename"Usage: impala_shell.py [options]Options:  -h, --help            show this help message and exit  -i IMPALAD, --impalad=IMPALAD                        <host:port> of impalad to connect to                        [default: hadoop-cluster-8-228:21000]                ......

可以看到,脚本获取到了,但是impala-shell识别不了。

版本二

仔细想了一下,应该是impala在解析sql语句时候的语法规范问题,修改一下脚本。

改成如下即可。

impala-shell -i $coordinator -q "$sql" -o $output_file

2016-04-11 19:08:00 hzct

作者:dantezhao | 简书 | CSDN | GITHUB 文章推荐:http://dantezhao.com/readme 个人主页:http://dantezhao.com 文章可以转载, 但必须以超链接形式标明文章原始出处和作者信息