Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/16893#discussion_r100707748
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/StringUtils.scala
---
@@ -27,21 +28,28 @@ object StringUtils {
// replace the % with .*, match 0 or more times with any character
def escapeLikeRegex(v: String): String = {
--- End diff --
Actually, I'm wrong: we can't quite do that simplification because the old
code has a subtle bug related to backslash-escaping. Due to the complexity and
terseness the old implementation, it's a little non-obvious to spot that the
`case (prev, '\\') => ""` has the effect of always ignoring backslash
characters, so this method is incapable of producing a backslash in its output.
This is a problem if the user wants to write a `LIKE` pattern to match
backslashes then this is impossible with the current code.
It turns out that this is covered by #15398, which also implements
performance improvements for this code, so I guess this PR and JIRA is
redundant :(
I thought #15398 had been merged / fixed by now, but I guess not.
---
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
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]