cloud-fan commented on code in PR #49103:
URL: https://github.com/apache/spark/pull/49103#discussion_r1900548063


##########
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:
   To confirm, now the patter match here is to match expressions who doesn't 
require all its children to have the same string collation, but only some of 
them, right?



-- 
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

Reply via email to