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


##########
connector/avro/src/main/scala/org/apache/spark/sql/avro/AvroDataToCatalyst.scala:
##########
@@ -80,12 +80,9 @@ private[sql] case class AvroDataToCatalyst(
   @transient private lazy val parseMode: ParseMode = {
     val mode = avroOptions.parseMode
     if (mode != PermissiveMode && mode != FailFastMode) {
-      throw new AnalysisException(
-        errorClass = "_LEGACY_ERROR_TEMP_3085",
-        messageParameters = Map(
-          "name" -> mode.name,
-          "permissiveMode" -> PermissiveMode.name,
-          "failFastMode" -> FailFastMode.name))
+      throw QueryCompilationErrors.parseModeUnsupportedError(
+        "from_avro", mode

Review Comment:
   Can't you pass `prettyName`?



##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -3809,6 +3809,12 @@
     ],
     "sqlState" : "42617"
   },
+  "PARSE_MODE_UNSUPPORTED" : {
+    "message" : [
+      "<funcName>() doesn't support the <mode> mode. Acceptable modes are 
<permissiveMode> and <failFastMode>."

Review Comment:
   ```suggestion
         "The function <funcName> doesn't support the <mode> mode. Acceptable 
modes are PERMISSIVE and FAILFAST."
   ```



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