MaxGekk commented on code in PR #47522:
URL: https://github.com/apache/spark/pull/47522#discussion_r1740183995
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala:
##########
@@ -2057,14 +2055,12 @@ case class ValidateExternalType(child: Expression,
expected: DataType, externalD
if (checkType(input)) {
input
} else {
- throw new RuntimeException(s"${input.getClass.getName}$errMsg")
+ throw QueryExecutionErrors.invalidExternalTypeError(
+ input.getClass.getName, expected.simpleString, child)
Review Comment:
the `simpleString()` and `toSQLType` might print types differently, we
should have unified representation of types in errors. Could you pass
`expected` to `invalidExternalTypeError()`, and wrap it by `toSQLType` inside
of it.
--
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]