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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:
##########
@@ -3848,7 +3848,8 @@ class AstBuilder extends DataTypeAstBuilder
               throw QueryParsingErrors.emptyQuantifiedPatternError(ctx)
             }
             val expressions = expressionList(ctx.expression)
-            if (expressions.forall(_.foldable) && 
expressions.forall(_.dataType == StringType)) {
+            if (expressions.forall(_.foldable) &&
+                expressions.forall(_.dataType.isInstanceOf[StringType])) {

Review Comment:
   **Blocking (P1):** This gate now admits explicitly collated 
STRING/CHAR/VARCHAR patterns, but the fast path evaluates them to `UTF8String` 
and constructs `LikeAny`/`LikeAll`, whose matching collation comes only from 
the left operand. That is not equivalent to the ordinary `Like`/`ILike` 
expansion: for example, binary `'FOO'` against `'foo%' COLLATE UTF8_LCASE` 
should match after collation coercion, while this path evaluates it 
case-sensitively and returns false. Please retain each pattern expression's 
resolved collation (including ILIKE's collation-aware `Lower`) or keep 
collation-bearing patterns on the existing expansion path, for ANY/SOME and ALL.



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