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

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


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 250c6fd  [SPARK-31954][SQL] Delete duplicate testcase in HiveQuerySuite
250c6fd is described below

commit 250c6fdecf169b2a6fa162af5034c3b67ea3f9bc
Author: GuoPhilipse <[email protected]>
AuthorDate: Thu Jun 11 22:03:40 2020 +0900

    [SPARK-31954][SQL] Delete duplicate testcase in HiveQuerySuite
    
    ### What changes were proposed in this pull request?
    remove duplicate test cases
    
    ### Why are the changes needed?
    improve test quality
    
    ### Does this PR introduce _any_ user-facing change?
    NO
    
    ### How was this patch tested?
    No  test
    
    Closes #28782 from GuoPhilipse/31954-delete-duplicate-testcase.
    
    Lead-authored-by: GuoPhilipse 
<[email protected]>
    Co-authored-by: GuoPhilipse <[email protected]>
    Signed-off-by: HyukjinKwon <[email protected]>
    (cherry picked from commit 912d45df7c6535336f72c971c90fecd11cfe87e9)
    Signed-off-by: HyukjinKwon <[email protected]>
---
 ...tamp cast #2-0-732ed232ac592c5e7f7c913a88874fd2 |  1 -
 ...amp cast #3-0-732ed232ac592c5e7f7c913a88874fd2} |  0
 ...amp cast #4-0-6d2da5cfada03605834e38bc4075bc79} |  0
 ...tamp cast #6-0-6d2da5cfada03605834e38bc4075bc79 |  1 -
 .../spark/sql/hive/execution/HiveQuerySuite.scala  | 26 +++++++++-------------
 5 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/sql/hive/src/test/resources/golden/timestamp cast 
#2-0-732ed232ac592c5e7f7c913a88874fd2 
b/sql/hive/src/test/resources/golden/timestamp cast 
#2-0-732ed232ac592c5e7f7c913a88874fd2
deleted file mode 100644
index 5625e59..0000000
--- a/sql/hive/src/test/resources/golden/timestamp cast 
#2-0-732ed232ac592c5e7f7c913a88874fd2   
+++ /dev/null
@@ -1 +0,0 @@
-1.2
diff --git a/sql/hive/src/test/resources/golden/timestamp cast 
#4-0-732ed232ac592c5e7f7c913a88874fd2 
b/sql/hive/src/test/resources/golden/timestamp cast 
#3-0-732ed232ac592c5e7f7c913a88874fd2
similarity index 100%
rename from sql/hive/src/test/resources/golden/timestamp cast 
#4-0-732ed232ac592c5e7f7c913a88874fd2
rename to sql/hive/src/test/resources/golden/timestamp cast 
#3-0-732ed232ac592c5e7f7c913a88874fd2
diff --git a/sql/hive/src/test/resources/golden/timestamp cast 
#8-0-6d2da5cfada03605834e38bc4075bc79 
b/sql/hive/src/test/resources/golden/timestamp cast 
#4-0-6d2da5cfada03605834e38bc4075bc79
similarity index 100%
rename from sql/hive/src/test/resources/golden/timestamp cast 
#8-0-6d2da5cfada03605834e38bc4075bc79
rename to sql/hive/src/test/resources/golden/timestamp cast 
#4-0-6d2da5cfada03605834e38bc4075bc79
diff --git a/sql/hive/src/test/resources/golden/timestamp cast 
#6-0-6d2da5cfada03605834e38bc4075bc79 
b/sql/hive/src/test/resources/golden/timestamp cast 
#6-0-6d2da5cfada03605834e38bc4075bc79
deleted file mode 100644
index 1d94c8a..0000000
--- a/sql/hive/src/test/resources/golden/timestamp cast 
#6-0-6d2da5cfada03605834e38bc4075bc79   
+++ /dev/null
@@ -1 +0,0 @@
--1.2
diff --git 
a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
 
b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
index 63b985f..b10a8cb 100644
--- 
a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
+++ 
b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
@@ -556,33 +556,27 @@ class HiveQuerySuite extends HiveComparisonTest with 
SQLTestUtils with BeforeAnd
     assert(1 == res.getDouble(0))
   }
 
-  createQueryTest("timestamp cast #2",
-    "SELECT CAST(CAST(1.2 AS TIMESTAMP) AS DOUBLE) FROM src LIMIT 1")
-
-  test("timestamp cast #3") {
-    val res = sql("SELECT CAST(CAST(1200 AS TIMESTAMP) AS INT) FROM src LIMIT 
1").collect().head
-    assert(1200 == res.getInt(0))
+  test("timestamp cast #2") {
+    val res = sql("SELECT CAST(CAST(-1 AS TIMESTAMP) AS DOUBLE) FROM src LIMIT 
1").collect().head
+    assert(-1 == res.get(0))
   }
 
-  createQueryTest("timestamp cast #4",
+  createQueryTest("timestamp cast #3",
     "SELECT CAST(CAST(1.2 AS TIMESTAMP) AS DOUBLE) FROM src LIMIT 1")
 
+  createQueryTest("timestamp cast #4",
+    "SELECT CAST(CAST(-1.2 AS TIMESTAMP) AS DOUBLE) FROM src LIMIT 1")
+
   test("timestamp cast #5") {
-    val res = sql("SELECT CAST(CAST(-1 AS TIMESTAMP) AS DOUBLE) FROM src LIMIT 
1").collect().head
-    assert(-1 == res.get(0))
+    val res = sql("SELECT CAST(CAST(1200 AS TIMESTAMP) AS INT) FROM src LIMIT 
1").collect().head
+    assert(1200 == res.getInt(0))
   }
 
-  createQueryTest("timestamp cast #6",
-    "SELECT CAST(CAST(-1.2 AS TIMESTAMP) AS DOUBLE) FROM src LIMIT 1")
-
-  test("timestamp cast #7") {
+  test("timestamp cast #6") {
     val res = sql("SELECT CAST(CAST(-1200 AS TIMESTAMP) AS INT) FROM src LIMIT 
1").collect().head
     assert(-1200 == res.getInt(0))
   }
 
-  createQueryTest("timestamp cast #8",
-    "SELECT CAST(CAST(-1.2 AS TIMESTAMP) AS DOUBLE) FROM src LIMIT 1")
-
   createQueryTest("select null from table",
     "SELECT null FROM src LIMIT 1")
 


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

Reply via email to