Impala 2.6.0, impala 2.3
CDH 5.5, CDH 5.7
Workaround: Use -q or -f flags to force impala-shell into non-interactive mode.
$ impala-shell < impalatest.sql;echo $?
Starting Impala Shell without Kerberos authentication
Connected to host-10-17-101:21000
Server version: impalad version 2.5.0-cdh5.7.0 RELEASE (build ad3f5adabedf56fe6bd9eea39147c067cc552703)
ERROR: AnalysisException: Syntax error in line 1:
Expected: ALTER, COMPUTE, CREATE, DESCRIBE, DROP, EXPLAIN, GRANT, INSERT, INVALIDATE, LOAD, REFRESH, REVOKE, SELECT, SET, SHOW, TRUNCATE, USE, VALUES, WITH
CAUSED BY: Exception: Syntax error
Notice 0 return code even though query 'sdkfsdkfj' had a syntax error.
This impala-shell behavior is inconsistent with other CLI tools return code
like beeline, hive, spark-shell etc.
We have to process return code so the whole workflow has to stop and send notification
if impala-shell has failed.
This issue only occurs if the -f query option is not specified.