[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-18 Thread jodersky
Github user jodersky commented on the issue: https://github.com/apache/spark/pull/15398 Agreed, I'll update the regex parsing to copy Hive's behaviour --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does n

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-16 Thread rxin
Github user rxin commented on the issue: https://github.com/apache/spark/pull/15398 In the case that there is no clear standard (e.g. all databases diverge), I'd say it's easier to just follow Hive's, unless it really doesn't make sense or is extremely difficult to support. --

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-16 Thread gatorsmile
Github user gatorsmile commented on the issue: https://github.com/apache/spark/pull/15398 If you check what we did in the other PRs, we do not need to strictly follow Hive. I do not have a strong opinion in all the above options. Let @rxin @yhuai make a decision. --- If your projec

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-16 Thread viirya
Github user viirya commented on the issue: https://github.com/apache/spark/pull/15398 Maybe more important is, how Hive performs `like`. For escaping before a non-special character, loos like it is different to above examples. If you gives pattern like `\a`, it matches exactly `\a`, n

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-16 Thread gatorsmile
Github user gatorsmile commented on the issue: https://github.com/apache/spark/pull/15398 We need to answer all the three questions listed by @jodersky --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-16 Thread viirya
Github user viirya commented on the issue: https://github.com/apache/spark/pull/15398 @gatorsmile That is for ending a pattern with the escape sequence. I mean escaping before a non-special character. --- If your project is set up for it, you can reply to this email and have your re

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-16 Thread gatorsmile
Github user gatorsmile commented on the issue: https://github.com/apache/spark/pull/15398 ``` ORA-01424: missing or illegal character following the escape character Cause: The character following the escape character in LIKE pattern is missing or not one of the escape char

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-16 Thread gatorsmile
Github user gatorsmile commented on the issue: https://github.com/apache/spark/pull/15398 This is different. > If there is no character after an escape character in the LIKE pattern, the pattern is not valid and the LIKE returns FALSE. --- If your project is set up for it, you

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-16 Thread gatorsmile
Github user gatorsmile commented on the issue: https://github.com/apache/spark/pull/15398 Checked Oracle. Oracle has the same behavior like DB2: ``` SQL> SELECT USERNAME FROM ALL_USERS WHERE USERNAME LIKE '%P%\' ESCAPE '\'; SELECT USERNAME FROM ALL_USERS WHERE USERNAME LIKE

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-16 Thread viirya
Github user viirya commented on the issue: https://github.com/apache/spark/pull/15398 > If the character after an escape character is not a wildcard character, the escape character is discarded and the character following the escape is treated as a regular character in the pattern.

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-16 Thread gatorsmile
Github user gatorsmile commented on the issue: https://github.com/apache/spark/pull/15398 Also checked SQL Server. It behaves differently from both `Postgre` and `DB2`. It simply ignores it. > If there is no character after an escape character in the LIKE pattern, the patter

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-16 Thread gatorsmile
Github user gatorsmile commented on the issue: https://github.com/apache/spark/pull/15398 That is a design decision we need to make. Personally, MySQL and PostgreSQL are not good examples we should follow. Let us ask ourselves a simple question: > When users input `'\a'`, what is

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-16 Thread viirya
Github user viirya commented on the issue: https://github.com/apache/spark/pull/15398 For escaping before a non-special character, I don't know if DB2 is special. Because as I try, MySQL behaving like PostgreSQL. --- If your project is set up for it, you can reply to this email and h

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-15 Thread gatorsmile
Github user gatorsmile commented on the issue: https://github.com/apache/spark/pull/15398 Also cc @yhuai , @JoshRosen and @mengxr --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-14 Thread jodersky
Github user jodersky commented on the issue: https://github.com/apache/spark/pull/15398 Thanks for the feedback. It was my plan to add the escape syntax in a separate PR. The main questions that I'm concerned with here are the points I enumerate in this PRs description, namely:

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-14 Thread gatorsmile
Github user gatorsmile commented on the issue: https://github.com/apache/spark/pull/15398 @jodersky Please follow @rxin 's suggestion and submit a separate PR to support it. Thanks! --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-14 Thread rxin
Github user rxin commented on the issue: https://github.com/apache/spark/pull/15398 Sounds like a good idea. It doesn't need to be in this PR though ... --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project doe

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-14 Thread gatorsmile
Github user gatorsmile commented on the issue: https://github.com/apache/spark/pull/15398 As @jodersky said, SQL2003 syntax is like ``` WHERE expression [NOT] LIKE string_pattern [ESCAPE escape_sequence] ``` ``` - ESCAPE escape_sequence Allows you to search for t

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-14 Thread AmplabJenkins
Github user AmplabJenkins commented on the issue: https://github.com/apache/spark/pull/15398 Test PASSed. Refer to this link for build results (access rights to CI server needed): https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/66974/ Test PASSed. ---

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-14 Thread AmplabJenkins
Github user AmplabJenkins commented on the issue: https://github.com/apache/spark/pull/15398 Merged build finished. Test PASSed. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature e

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-14 Thread SparkQA
Github user SparkQA commented on the issue: https://github.com/apache/spark/pull/15398 **[Test build #66974 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/66974/consoleFull)** for PR 15398 at commit [`ff6a68c`](https://github.com/apache/spark/commit/

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-14 Thread SparkQA
Github user SparkQA commented on the issue: https://github.com/apache/spark/pull/15398 **[Test build #66974 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/66974/consoleFull)** for PR 15398 at commit [`ff6a68c`](https://github.com/apache/spark/commit/f

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-13 Thread jodersky
Github user jodersky commented on the issue: https://github.com/apache/spark/pull/15398 The style issues are weird. Running scalastyle in sbt worked fine... --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-13 Thread SparkQA
Github user SparkQA commented on the issue: https://github.com/apache/spark/pull/15398 **[Test build #66918 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/66918/consoleFull)** for PR 15398 at commit [`6584853`](https://github.com/apache/spark/commit/

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-13 Thread AmplabJenkins
Github user AmplabJenkins commented on the issue: https://github.com/apache/spark/pull/15398 Merged build finished. Test FAILed. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature e

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-13 Thread AmplabJenkins
Github user AmplabJenkins commented on the issue: https://github.com/apache/spark/pull/15398 Test FAILed. Refer to this link for build results (access rights to CI server needed): https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/66918/ Test FAILed. ---

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-13 Thread jodersky
Github user jodersky commented on the issue: https://github.com/apache/spark/pull/15398 thanks @yhuai for the feedback! I enumerated some issues in the pull request description, do you have any input on them? My personal opinion is that we should change the regex matching to conform t

[GitHub] spark issue #15398: [SPARK-17647][SQL][WIP] Fix backslash escaping in 'LIKE'...

2016-10-13 Thread SparkQA
Github user SparkQA commented on the issue: https://github.com/apache/spark/pull/15398 **[Test build #66918 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/66918/consoleFull)** for PR 15398 at commit [`6584853`](https://github.com/apache/spark/commit/6