This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 4c740613d2cd [SPARK-45385][SQL][TESTS][FOLLOWUP] Improve the test case 
for deprecate `spark.sql.parser.escapedStringLiterals`
4c740613d2cd is described below

commit 4c740613d2cd1c4a4c87d4dfef30a70d8317edd3
Author: Jiaan Geng <[email protected]>
AuthorDate: Sat Oct 7 11:54:57 2023 +0900

    [SPARK-45385][SQL][TESTS][FOLLOWUP] Improve the test case for deprecate 
`spark.sql.parser.escapedStringLiterals`
    
    ### What changes were proposed in this pull request?
    This PR follows up https://github.com/apache/spark/pull/43187 and improve 
the test case.
    
    ### Why are the changes needed?
    Avoid create data set duplicately of the test case.
    
    ### Does this PR introduce _any_ user-facing change?
    'No'.
    Just update the test cases.
    
    ### How was this patch tested?
    Test cases updated.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    'No'.
    
    Closes #43200 from beliefer/SPARK-45385_followup.
    
    Authored-by: Jiaan Geng <[email protected]>
    Signed-off-by: Hyukjin Kwon <[email protected]>
---
 sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala 
b/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
index 8fb25e120f54..ca06e0f2bf2c 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
@@ -1872,6 +1872,8 @@ class DatasetSuite extends QueryTest
   }
 
   test("SPARK-20399: do not unescaped regex pattern when 
ESCAPED_STRING_LITERALS is enabled") {
+    val df = Seq("\u0020\u0021\u0023", "abc").toDF()
+
     Seq(
       true ->
         ("value rlike '^\\x20[\\x20-\\x23]+$'", "value rlike 
'^\\\\x20[\\\\x20-\\\\x23]+$'"),
@@ -1879,8 +1881,6 @@ class DatasetSuite extends QueryTest
         ("value rlike r'^\\x20[\\x20-\\x23]+$'", "value rlike 
r'^\\\\x20[\\\\x20-\\\\x23]+$'")
     ).foreach { case (escaped, (filter1, filter3)) =>
       withSQLConf(SQLConf.ESCAPED_STRING_LITERALS.key -> escaped.toString) {
-        val data = Seq("\u0020\u0021\u0023", "abc")
-        val df = data.toDF()
         val rlike1 = df.filter(filter1)
         val rlike2 = df.filter($"value".rlike("^\\x20[\\x20-\\x23]+$"))
         val rlike3 = df.filter(filter3)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to