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

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/Column.scala
 ##########
 @@ -822,6 +822,16 @@ class Column(val expr: Expression) extends Logging {
    */
   def like(literal: String): Column = withExpr { Like(expr, lit(literal).expr) 
}
 
+  /**
+   * SQL like expression. Returns a boolean column based on a SQL LIKE ESCAPE 
match.
+   *
+   * @group expr_ops
+   * @since 3.0.0
+   */
+  def like(literal: String, escapeStr: String): Column = withExpr {
+    Like(expr, lit(literal).expr, Option(escapeStr))
+  }
+
 
 Review comment:
   I'm neutral on adding this. Is that enough to just use the SQL interface for 
this escape? 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to