You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "MaxGekk (via GitHub)" <gi...@apache.org> on 2023/04/04 10:38:42 UTC

[GitHub] [spark] MaxGekk commented on a diff in pull request #40660: [SPARK-43028][SQL] Add error class SQL_CONF_NOT_FOUND

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -1414,6 +1414,11 @@
       "sortBy must be used together with bucketBy."
     ]
   },
+  "SQL_CONF_NOT_FOUND" : {
+    "message" : [
+      "The SQL config \"<key>\" cannot be found. Please verify that the config exists."

Review Comment:
   Please, quote the config in the code and remove "" around the key:
   ```suggestion
         "The SQL config <sqlConf> cannot be found. Please verify that the config exists."
   ```



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala:
##########
@@ -2134,8 +2134,10 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase {
       cause = null)
   }
 
-  def noSuchElementExceptionError(key: String): Throwable = {
-    new NoSuchElementException(key)
+  def sqlConfigNotFoundError(key: String): SparkRuntimeException = {
+    new SparkRuntimeException(
+      errorClass = "SQL_CONF_NOT_FOUND",
+      messageParameters = Map("key" -> key))

Review Comment:
   Please, quote the config using `toSQLConf()`



-- 
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-unsubscribe@spark.apache.org

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


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