heyihong commented on code in PR #54008:
URL: https://github.com/apache/spark/pull/54008#discussion_r2742353657


##########
sql/api/src/main/scala/org/apache/spark/sql/AnalysisException.scala:
##########
@@ -139,18 +139,15 @@ class AnalysisException protected (
       cause = cause)
 
   def this(
-      message: String,
-      cause: Option[Throwable],
-      errorClass: Option[String],
+      errorClass: String,
       messageParameters: Map[String, String],
       context: Array[QueryContext],
+      cause: Option[Throwable],
       sqlState: Option[String]) =
     this(
-      message = message,
-      line = None,
-      startPosition = None,
+      message = SparkThrowableHelper.getMessage(errorClass, messageParameters),
       cause = cause,
-      errorClass = errorClass,
+      errorClass = Option(errorClass),

Review Comment:
   It’s not about correctness but about readability. IMHO, handling null here 
may confuse future readers, making them think about cases where errorClass can 
be null or that null can be passed to this constructor (since it appears that 
null is handled).



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