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

Sascha Wiegleb commented on SPARK-17647:
----------------------------------------

I have tested this behavior with spark 2.4.2 and it seems to be that the bug is 
still there.

With: 
{code:java}
spark.sql.parser.escapedStringLiterals=true
{code}
backslash it is working, but I run into failures with escaping " and ' .
{code:java}
the escape character is not allowed to precede '\"'
{code}
I have tested the behavior with the following special characters and their 
escaping:
{code:java}
_ % \ ' "
{code}
So both modes will not cover the full spectrum of escaping special characters.

 

> 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
>            Priority: Major
>              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
(v7.6.3#76005)

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

Reply via email to