srielau commented on code in PR #58413:
URL: https://github.com/apache/spark/pull/58413#discussion_r3906085909


##########
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:
   Addressed in 18a45fe4ee2. The `LikeAny`/`LikeAll` fast path now accepts only 
resolved STRING/CHAR/VARCHAR expressions without explicit collation. Explicitly 
collated patterns remain as ordinary `Like`/`ILike` expansions, preserving each 
pattern expression and ILIKE's collation-aware `Lower`.
   
   The regression covers LIKE/ILIKE, ANY/SOME/ALL, negation, and explicitly 
collated STRING/CHAR/VARCHAR patterns, asserting equivalence with the 
corresponding ordinary predicate. One detail from local verification: ordinary 
`'FOO' LIKE ('foo%' COLLATE UTF8_LCASE)` currently returns false because `Like` 
takes matching collation from the left operand; this change preserves that 
existing expansion behavior rather than introducing a new pattern-side 
precedence rule.



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