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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CollationTypeCoercion.scala:
##########
@@ -223,151 +277,195 @@ object CollationTypeCoercion {
     val collationContextWinner = 
expressions.foldLeft(findCollationContext(expressions.head)) {
       case (Some(left), right) =>
         findCollationContext(right).flatMap { ctx =>
-          collationPrecedenceWinner(left, ctx)
+          mergeWinner(left, ctx)
         }
       case (None, _) => return None

Review Comment:
   nice catch, removed the return



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CollationTypeCoercion.scala:
##########
@@ -223,151 +277,195 @@ object CollationTypeCoercion {
     val collationContextWinner = 
expressions.foldLeft(findCollationContext(expressions.head)) {
       case (Some(left), right) =>
         findCollationContext(right).flatMap { ctx =>
-          collationPrecedenceWinner(left, ctx)
+          mergeWinner(left, ctx)
         }
       case (None, _) => return None
     }
-
-    collationContextWinner.flatMap { cc =>
-      extractStringType(cc.dataType)
-    }
+    collationContextWinner
   }
 
   /**
    * Tries to find the collation context for the given expression.
    * If found, it will also set the [[COLLATION_CONTEXT_TAG]] on the 
expression,
    * so that the context can be reused later.
    */
-  private def findCollationContext(expr: Expression): Option[CollationContext] 
= {
+  private def findCollationContext(expr: Expression): Option[DataType] = {

Review Comment:
   done!



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

Reply via email to