davidm-db commented on code in PR #47648:
URL: https://github.com/apache/spark/pull/47648#discussion_r1709070600


##########
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:
   @cloud-fan do we want to return internal errors in such cases? this is not 
expected to be hit ever, so I guess it's fine since it would mean we have a bug.



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