Lichuanliang created SPARK-33358:
------------------------------------
Summary: Spark SQL CLI command processing loop can't exit while
one comand fail
Key: SPARK-33358
URL: https://issues.apache.org/jira/browse/SPARK-33358
Project: Spark
Issue Type: Bug
Components: SQL
Affects Versions: 3.0.1
Reporter: Lichuanliang
When submit a multiple statements sql script through bin/spark-sql, if one of
the prior command fail, the processing loop will not exit and continuing
executing the following statements, and finally makes the whole program
success.
{code:java}
for (oneCmd <- commands) {
if (StringUtils.endsWith(oneCmd, "\\")) {
command += StringUtils.chop(oneCmd) + ";"
} else {
command += oneCmd
if (!StringUtils.isBlank(command)) {
val ret = processCmd(command)
command = ""
lastRet = ret
val ignoreErrors = HiveConf.getBoolVar(conf,
HiveConf.ConfVars.CLIIGNOREERRORS)
if (ret != 0 && !ignoreErrors) {
CommandProcessorFactory.clean(conf.asInstanceOf[HiveConf])
ret // for loop will not return if one of the commands fail
}
}
}
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]