[ https://issues.apache.org/jira/browse/SPARK-33358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17232430#comment-17232430 ]
Dongjoon Hyun commented on SPARK-33358: --------------------------------------- I verified this and updated the PR description. This is a regression at Apache Spark 3.0.0 (and 3.0.1). Not only the final return code of `Spark SQL shell` is wrong, but also the query result and DDL can be wrong due to the ignorance of the failure. > 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.0, 3.0.1 > Reporter: Lichuanliang > Priority: Major > Labels: correctness > > > 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: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org