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

Dong Jiang commented on SPARK-17647:
------------------------------------

Are we sure this issue is resolved, I tested the following on spark-shell 2.2.0
{code}
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /___/ .__/\_,_/_/ /_/\_\   version 2.2.0
      /_/
         
Using Scala version 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25)
Type in expressions to have them evaluated.
Type :help for more information.

scala> spark.sql("select '\\\\' like '%\\%'").show
+----------+
|\ LIKE %\%|
+----------+
|     false|
+----------+
{code}
same in spark-sql
{code}
spark-sql> select '\\\\' like '%\\%';
false
Time taken: 2.296 seconds, Fetched 1 row(s)
{code}


> SQL LIKE does not handle backslashes correctly
> ----------------------------------------------
>
>                 Key: SPARK-17647
>                 URL: https://issues.apache.org/jira/browse/SPARK-17647
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Xiangrui Meng
>            Assignee: Xiangrui Meng
>              Labels: correctness
>             Fix For: 2.1.1, 2.2.0
>
>
> Try the following in SQL shell:
> {code}
> select '\\\\' like '%\\%';
> {code}
> It returned false, which is wrong.
> cc: [~yhuai] [~joshrosen]
> A false-negative considered previously:
> {code}
> select '\\\\' rlike '.*\\\\\\\\.*';
> {code}
> It returned true, which is correct if we assume that the pattern is treated 
> as a Java string but not raw string.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to