mrk-andreev commented on code in PR #47522:
URL: https://github.com/apache/spark/pull/47522#discussion_r1740164418
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala:
##########
@@ -2057,14 +2055,17 @@ case class ValidateExternalType(child: Expression,
expected: DataType, externalD
if (checkType(input)) {
input
} else {
- throw new RuntimeException(s"${input.getClass.getName}$errMsg")
+ throw new SparkRuntimeException("INVALID_EXTERNAL_TYPE",
+ Map(
+ "actualType" -> input.getClass.getName,
+ "expectedType" -> expected.simpleString,
+ "childExpression" -> child.toString
Review Comment:
Thank you.
Applyied at `QueryExecutionErrors`:
```
def invalidExternalTypeError(
actualType: String, expectedType: String, childExpression:
Expression): SparkRuntimeException = {
new SparkRuntimeException(
errorClass = "INVALID_EXTERNAL_TYPE",
messageParameters = Map(
"actualType" -> actualType,
"expectedType" -> expectedType,
"childExpression" -> toSQLExpr(childExpression)
)
)
}
```
--
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]