[SPARK-4935][SQL] When hive.cli.print.header configured, spark-sql aborted if passed in a invalid sql

If we passed in a wrong sql like ```abdcdfsfs```, the spark-sql script aborted.

Author: wangfei <wangfei1@huawei.com>
Author: Fei Wang <wangfei1@huawei.com>

Closes #3761 from scwf/patch-10 and squashes the following commits:

46dc344 [Fei Wang] revert console.printError(rc.getErrorMessage())
0330e07 [wangfei] avoid to print error message repeatedly
1614a11 [wangfei] spark-sql abort when passed in a wrong sql
This commit is contained in:
wangfei 2014-12-30 13:44:30 -08:00 committed by Michael Armbrust
parent 7425bec320
commit 8f29b7cafc

View file

@ -60,7 +60,7 @@ private[hive] abstract class AbstractSparkSQLDriver(
} catch {
case cause: Throwable =>
logError(s"Failed in [$command]", cause)
new CommandProcessorResponse(0, ExceptionUtils.getFullStackTrace(cause), null)
new CommandProcessorResponse(1, ExceptionUtils.getFullStackTrace(cause), null)
}
}