cloud-fan commented on code in PR #47648:
URL: https://github.com/apache/spark/pull/47648#discussion_r1709518484
##########
sql/core/src/main/scala/org/apache/spark/sql/scripting/SqlScriptingExecutionNode.scala:
##########
@@ -78,11 +82,14 @@ trait NonLeafStatementExec extends CompoundStatementExec {
case Array(field) if field.dataType == BooleanType =>
df.limit(2).collect() match {
case Array(row) => row.getBoolean(0)
- case _ => false
+ case _ =>
+ throw
QueryExecutionErrors.invalidBooleanStatementError(statement.getText)
}
- case _ => false
+ case _ =>
+ throw
QueryExecutionErrors.invalidBooleanStatementError(statement.getText)
}
- case _ => false
+ case _ =>
+ throw SparkException.internalError("Boolean condition must be
SingleStatementExec")
Review Comment:
Does this mean the boolean query returns more than one column? It seems not
possible to happen and internal error LGTM.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]