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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala:
##########
@@ -158,7 +162,9 @@ case class Like(left: Expression, right: Expression, 
escapeChar: Char)
         val regexStr =
           
StringEscapeUtils.escapeJava(escape(rVal.asInstanceOf[UTF8String].toString()))
         val pattern = ctx.addMutableState(patternClass, "patternLike",
-          v => s"""$v = $patternClass.compile("$regexStr");""")
+          v =>
+            s"""$v = $patternClass.compile("$regexStr",
+               
|CollationSupport.collationAwareRegexFlags($collationId));""".stripMargin)

Review Comment:
   Actually we can put the result in a lazy and use it in both interpreted and 
codegen.



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala:
##########
@@ -158,7 +162,9 @@ case class Like(left: Expression, right: Expression, 
escapeChar: Char)
         val regexStr =
           
StringEscapeUtils.escapeJava(escape(rVal.asInstanceOf[UTF8String].toString()))
         val pattern = ctx.addMutableState(patternClass, "patternLike",
-          v => s"""$v = $patternClass.compile("$regexStr");""")
+          v =>
+            s"""$v = $patternClass.compile("$regexStr",
+               
|CollationSupport.collationAwareRegexFlags($collationId));""".stripMargin)

Review Comment:
   Actually we can put the result in a lazy val and use it in both interpreted 
and codegen.



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