beliefer commented on a change in pull request #25001: [SPARK-28083][SQL] 
Support LIKE ... ESCAPE syntax
URL: https://github.com/apache/spark/pull/25001#discussion_r302354873
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala
 ##########
 @@ -103,13 +106,16 @@ abstract class StringRegexExpression extends 
BinaryExpression
     Use RLIKE to match with standard regular expressions.
   """,
   since = "1.0.0")
-case class Like(left: Expression, right: Expression) extends 
StringRegexExpression {
+case class Like(left: Expression, right: Expression, escapeCharOpt: 
Option[String] = None)
+  extends StringRegexExpression {
 
-  override def escape(v: String): String = StringUtils.escapeLikeRegex(v)
+  private lazy val escapeStr = escapeCharOpt.getOrElse("\\")
 
 Review comment:
   `escapeStr` works fine in line 111, but not normal in line 149. 
   If I change to:
   `private lazy val escapeStr = escapeCharOpt.getOrElse("""\\""")`
   `escapeStr` works fine in line 149, but not normal in line 111. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to