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


##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -3004,6 +3004,12 @@
     ],
     "sqlState" : "2200E"
   },
+  "NULL_QUERY_STRING_EXECUTE_IMMEDIATE" : {
+    "message" : [
+      "Execute immediate requires non-null value for sqlString variable, but 
provided <varName> is null."

Review Comment:
   Is it clear from user perspective what's `sqlString` is?
   
   How about:
   ```suggestion
         "Execute immediate requires a non-null variable as its argument, but 
the provided variable <varName> is null."
   ```



##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -3004,6 +3004,12 @@
     ],
     "sqlState" : "2200E"
   },
+  "NULL_QUERY_STRING_EXECUTE_IMMEDIATE" : {
+    "message" : [
+      "Execute immediate requires non-null value for sqlString variable, but 
provided <varName> is null."

Review Comment:
   or
   ```suggestion
         "Execute immediate requires a non-null variable as the query string, 
but the provided variable <varName> is null."
   ```



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -3954,6 +3954,12 @@ private[sql] object QueryCompilationErrors extends 
QueryErrorsBase with Compilat
       messageParameters = Map("varType" -> toSQLType(dataType)))
   }
 
+  def nullSQLStringExecuteImmediate(varName: String): Throwable = {
+    throw new AnalysisException(
+      errorClass = "NULL_QUERY_STRING_EXECUTE_IMMEDIATE",
+      messageParameters = Map("varName" -> varName))

Review Comment:
   Please, quote `varName` by `toSQLId` since it is an identifier, I guess. 
Isn't it?



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to