MaxGekk commented on code in PR #48495:
URL: https://github.com/apache/spark/pull/48495#discussion_r1805046522
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -3646,10 +3646,12 @@ private[sql] object QueryCompilationErrors extends
QueryErrorsBase with Compilat
)
}
- def implicitCollationMismatchError(): Throwable = {
+ def implicitCollationMismatchError(implicitTypes: Seq[String]): Throwable = {
new AnalysisException(
errorClass = "COLLATION_MISMATCH.IMPLICIT",
- messageParameters = Map.empty
+ messageParameters = Map(
+ "implicitTypes" -> implicitTypes.map(toSQLId).mkString(", ")
Review Comment:
Use `toSQLType` instead of `toSQLId`
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CollationTypeCasts.scala:
##########
@@ -191,7 +191,9 @@ object CollationTypeCasts extends TypeCoercionRule {
.distinct
if (implicitTypes.length > 1) {
- throw QueryCompilationErrors.implicitCollationMismatchError()
+ throw QueryCompilationErrors.implicitCollationMismatchError(
+ implicitTypes.map(t => StringType(t).typeName)
Review Comment:
Please, form the type names via `toSQLType`. It would be better to pass
types inside of `implicitCollationMismatchError`, and form names there as it
follows the existing convention.
--
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]