You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Jakob Odersky (JIRA)" <ji...@apache.org> on 2016/10/19 23:01:03 UTC

[jira] [Commented] (SPARK-18018) Specify alternate escape character in 'LIKE' expression

    [ https://issues.apache.org/jira/browse/SPARK-18018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15590136#comment-15590136 ] 

Jakob Odersky commented on SPARK-18018:
---------------------------------------

I've started a very early prototype [here|https://github.com/jodersky/spark/compare/SPARK-17647...jodersky:escape].
It's still very much wip and I'm currently pondering whether to make `like` expressions ternary or include the `escape` option in a new `pattern` expression. Any feedback is welcome!

> Specify alternate escape character in 'LIKE' expression
> -------------------------------------------------------
>
>                 Key: SPARK-18018
>                 URL: https://issues.apache.org/jira/browse/SPARK-18018
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Jakob Odersky
>
> Spark currently uses the backslash character (&#92;) to escape patterns in 'LIKE' expressions.
> Other RDBMS ([MS|https://msdn.microsoft.com/en-us/library/ms179859.aspx], [Oracle|https://docs.oracle.com/cd/B12037_01/server.101/b10759/conditions016.htm], [DB2|http://www.ibm.com/support/knowledgecenter/SSEPEK_11.0.0/sqlref/src/tpc/db2z_likepredicate.html], [MySQL|http://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html], [PostgreSQL|https://www.postgresql.org/docs/9.0/static/functions-matching.html], [Hive|https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF]) support specifying an alternate escape character with an extended syntax of the `LIKE` operator.
> The syntax is the same in all above mentioned systems and is described as follows:
> {code}
> expression LIKE pattern [ESCAPE escapeChar]
> {code}
> where {{escapeChar}} is a single-character expression that will replace the backslash as escape character.
> Adding this extended to Spark SQL would be a usability improvement for users coming from other systems.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org