garlandz-db commented on code in PR #54008:
URL: https://github.com/apache/spark/pull/54008#discussion_r2742236544
##########
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:
Its safer to do Option(..). in the case errorClass = null then Option(null)
becomes None while Some(null) != None..Ive hat a bad experience with that before
--
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]