milastdbx commented on code in PR #45462:
URL: https://github.com/apache/spark/pull/45462#discussion_r1521059360


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/executeImmediate.scala:
##########
@@ -88,10 +88,16 @@ class SubstituteExecuteImmediate(val catalogManager: 
CatalogManager)
           throw 
QueryCompilationErrors.invalidExecuteImmediateVariableType(varReference.dataType)
         }
 
+        val varReferenceValue = varReference.eval(null)
+
+        if (varReferenceValue == null) {
+          throw QueryCompilationErrors.nullSQLStringExecuteImmediate(u.name)
+        }
+
         // Call eval with null value passed instead of a row.

Review Comment:
   you forgot to move comment above `eval`



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