heyihong commented on code in PR #54008:
URL: https://github.com/apache/spark/pull/54008#discussion_r2742290959
##########
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:
Based on the code, this constructor is in GrpcExceptionConverter.scala (BTW,
we can limit the visibility of this method by using private[sql]), if I
understand correctly. A null value for errorClass is invalid input, so it
should fail early instead of being converted to None. We can add
assert(errorClass != null) for safety.
--
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]