maropu commented on a change in pull request #25001: [SPARK-28083][SQL] Support
LIKE ... ESCAPE syntax
URL: https://github.com/apache/spark/pull/25001#discussion_r309971143
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/StringUtilsSuite.scala
##########
@@ -23,13 +23,30 @@ import org.apache.spark.sql.catalyst.util.StringUtils._
class StringUtilsSuite extends SparkFunSuite {
test("escapeLikeRegex") {
- assert(escapeLikeRegex("abdef") ===
"(?s)\\Qa\\E\\Qb\\E\\Qd\\E\\Qe\\E\\Qf\\E")
- assert(escapeLikeRegex("a\\__b") === "(?s)\\Qa\\E\\Q_\\E.\\Qb\\E")
- assert(escapeLikeRegex("a_%b") === "(?s)\\Qa\\E..*\\Qb\\E")
- assert(escapeLikeRegex("a%\\%b") === "(?s)\\Qa\\E.*\\Q%\\E\\Qb\\E")
- assert(escapeLikeRegex("a%") === "(?s)\\Qa\\E.*")
- assert(escapeLikeRegex("**") === "(?s)\\Q*\\E\\Q*\\E")
- assert(escapeLikeRegex("a_b") === "(?s)\\Qa\\E.\\Qb\\E")
+ val expectedEscapedStrArr =
Array("(?s)\\Qa\\E\\Qb\\E\\Qd\\E\\Qe\\E\\Qf\\E",
Review comment:
Can you assign these expected strings to each independent variable?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]