cloud-fan commented on code in PR #49103: URL: https://github.com/apache/spark/pull/49103#discussion_r1904853544
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CollationTypeCoercion.scala: ########## @@ -38,10 +39,10 @@ object CollationTypeCoercion { } def apply(expression: Expression): Expression = expression match { - case ifExpr: If => - ifExpr.withNewChildren( - ifExpr.predicate +: collateToSingleType(Seq(ifExpr.trueValue, ifExpr.falseValue)) - ) + case expr if shouldFailWithIndeterminateCollation(expr) => + expr.failAnalysis( + errorClass = "INDETERMINATE_COLLATION_IN_EXPRESSION", + messageParameters = Map("expr" -> toSQLExpr(expr))) case caseWhenExpr: CaseWhen if !haveSameType(caseWhenExpr.inputTypesForMerging) => Review Comment: I mean, all the case matches left here are for special cases that need to select the children that need to have the same collation. It's not many: CaseWhen, CreateMap, CreateNamedStruct, GetMapValue. Do I understand it correctly? -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org