-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-4061][SQL] We cannot use EOL character in the operand of LIKE predicate. #2908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
QA tests have started for PR 2908 at commit
|
|
QA tests have finished for PR 2908 at commit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel a little complicated about this... This function is not on critical path, so I'd like to refactor it in a more functional and arguably more readable (but less efficient) way, for example:
override def escape(v: String) = "(?s)" + (' ' +: v.init).zip(v).flatMap {
case (prefix, '_') => if (prefix == '\\') "_" else "."
case (prefix, '%') => if (prefix == '\\') "%" else ".*"
case (_, ch) => Character.toString(ch)
}.mkString|
Good catch! Would you mind to add a unit test for this? |
|
Thanks @liancheng ! I've refactored and added test cases. |
|
Test build #22121 has finished for PR 2908 at commit
|
|
Test build #22130 has finished for PR 2908 at commit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see, we need to remove leading \\.
|
LGTM, thanks for fixing this! |
|
Test build #22205 has finished for PR 2908 at commit
|
|
retest this please. |
|
Test build #22214 has finished for PR 2908 at commit
|
|
retest this please. |
|
Test build #22243 has finished for PR 2908 at commit
|
|
Test build #22245 has finished for PR 2908 at commit
|
|
It looks like the build configuration for the thriftserver tests may be broken, which is why they're failing: |
|
Thanks, I'll try to create another branch from master and then push. |
6bc3318 to
f99a2f4
Compare
|
Test build #22254 has finished for PR 2908 at commit
|
|
Ah, I see. It's related to #2950. |
|
Test build #453 has finished for PR 2908 at commit
|
|
Test build #22260 has finished for PR 2908 at commit
|
|
Test build #464 has finished for PR 2908 at commit
|
|
Thanks for working on this! Merged to master. |
We cannot use EOL character like \n or \r in the operand of LIKE predicate.
So following condition is never true.