stefankandic commented on code in PR #49103:
URL: https://github.com/apache/spark/pull/49103#discussion_r1903964108


##########
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:
   This line wasn't changed so I'm not sure what exactly you are referring to. 
However all of these expressions require all string types to have the same 
collation, `CaseWhen` is just special cased because of the special logic for 
getting all string types in the branches 



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