cloud-fan commented on code in PR #47648:
URL: https://github.com/apache/spark/pull/47648#discussion_r1711532041


##########
sql/core/src/main/scala/org/apache/spark/sql/scripting/SqlScriptingExecutionNode.scala:
##########
@@ -78,11 +82,15 @@ 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 SqlScriptingErrors.booleanStatementTooManyRows(

Review Comment:
   same here, the parser only allows expression for the IF condition and we 
build a one row relation internally to turn the expression into a logical plan. 
It will never return more than one rows. We can throw internal error here.



-- 
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]

Reply via email to