You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2022/06/02 01:32:34 UTC

[spark] branch branch-3.3 updated: [SPARK-39040][SQL][FOLLOWUP] Use a unique table name in conditional-functions.sql

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

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


The following commit(s) were added to refs/heads/branch-3.3 by this push:
     new 37aa0793ae1 [SPARK-39040][SQL][FOLLOWUP] Use a unique table name in conditional-functions.sql
37aa0793ae1 is described below

commit 37aa0793ae1b4018eb331c1ccd4de9bd5aef9905
Author: Wenchen Fan <we...@databricks.com>
AuthorDate: Thu Jun 2 10:31:53 2022 +0900

    [SPARK-39040][SQL][FOLLOWUP] Use a unique table name in conditional-functions.sql
    
    ### What changes were proposed in this pull request?
    
    This is a followup of https://github.com/apache/spark/pull/36376, to use a unique table name in the test. `t` is a quite common table name and may make test environment unstable.
    
    ### Why are the changes needed?
    
    make tests more stable
    
    ### Does this PR introduce _any_ user-facing change?
    
    no
    
    ### How was this patch tested?
    
    N/A
    
    Closes #36739 from cloud-fan/test.
    
    Authored-by: Wenchen Fan <we...@databricks.com>
    Signed-off-by: Hyukjin Kwon <gu...@apache.org>
    (cherry picked from commit 4f672db5719549c522a24cffe7b4d0c1e0cb859b)
    Signed-off-by: Hyukjin Kwon <gu...@apache.org>
---
 .../sql-tests/inputs/ansi/conditional-functions.sql      | 16 ++++++++--------
 .../sql-tests/results/ansi/conditional-functions.sql.out | 16 ++++++++--------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/sql/core/src/test/resources/sql-tests/inputs/ansi/conditional-functions.sql b/sql/core/src/test/resources/sql-tests/inputs/ansi/conditional-functions.sql
index ba8f0ffe7f1..e7835619f58 100644
--- a/sql/core/src/test/resources/sql-tests/inputs/ansi/conditional-functions.sql
+++ b/sql/core/src/test/resources/sql-tests/inputs/ansi/conditional-functions.sql
@@ -1,21 +1,21 @@
 -- Tests for conditional functions
 
-CREATE TABLE t USING PARQUET AS SELECT c1, c2 FROM VALUES(1d, 0),(2d, 1),(null, 1),(CAST('NaN' AS DOUBLE), 0) AS t(c1, c2);
+CREATE TABLE conditional_t USING PARQUET AS SELECT c1, c2 FROM VALUES(1d, 0),(2d, 1),(null, 1),(CAST('NaN' AS DOUBLE), 0) AS t(c1, c2);
 
-SELECT nanvl(c2, c1/c2 + c1/c2) FROM t;
-SELECT nanvl(c2, 1/0) FROM t;
-SELECT nanvl(1-0, 1/0) FROM t;
+SELECT nanvl(c2, c1/c2 + c1/c2) FROM conditional_t;
+SELECT nanvl(c2, 1/0) FROM conditional_t;
+SELECT nanvl(1-0, 1/0) FROM conditional_t;
 
-SELECT if(c2 >= 0, 1-0, 1/0) from t;
+SELECT if(c2 >= 0, 1-0, 1/0) from conditional_t;
 SELECT if(1 == 1, 1, 1/0);
 SELECT if(1 != 1, 1/0, 1);
 
-SELECT coalesce(c2, 1/0) from t;
+SELECT coalesce(c2, 1/0) from conditional_t;
 SELECT coalesce(1, 1/0);
 SELECT coalesce(null, 1, 1/0);
 
-SELECT case when c2 >= 0 then 1 else 1/0 end from t;
+SELECT case when c2 >= 0 then 1 else 1/0 end from conditional_t;
 SELECT case when 1 < 2 then 1 else 1/0 end;
 SELECT case when 1 > 2 then 1/0 else 1 end;
 
-DROP TABLE IF EXISTS t;
+DROP TABLE conditional_t;
diff --git a/sql/core/src/test/resources/sql-tests/results/ansi/conditional-functions.sql.out b/sql/core/src/test/resources/sql-tests/results/ansi/conditional-functions.sql.out
index 6a4f694f4d7..e62654c3e23 100644
--- a/sql/core/src/test/resources/sql-tests/results/ansi/conditional-functions.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/ansi/conditional-functions.sql.out
@@ -3,7 +3,7 @@
 
 
 -- !query
-CREATE TABLE t USING PARQUET AS SELECT c1, c2 FROM VALUES(1d, 0),(2d, 1),(null, 1),(CAST('NaN' AS DOUBLE), 0) AS t(c1, c2)
+CREATE TABLE conditional_t USING PARQUET AS SELECT c1, c2 FROM VALUES(1d, 0),(2d, 1),(null, 1),(CAST('NaN' AS DOUBLE), 0) AS t(c1, c2)
 -- !query schema
 struct<>
 -- !query output
@@ -11,7 +11,7 @@ struct<>
 
 
 -- !query
-SELECT nanvl(c2, c1/c2 + c1/c2) FROM t
+SELECT nanvl(c2, c1/c2 + c1/c2) FROM conditional_t
 -- !query schema
 struct<nanvl(c2, ((c1 / c2) + (c1 / c2))):double>
 -- !query output
@@ -22,7 +22,7 @@ struct<nanvl(c2, ((c1 / c2) + (c1 / c2))):double>
 
 
 -- !query
-SELECT nanvl(c2, 1/0) FROM t
+SELECT nanvl(c2, 1/0) FROM conditional_t
 -- !query schema
 struct<nanvl(c2, (1 / 0)):double>
 -- !query output
@@ -33,7 +33,7 @@ struct<nanvl(c2, (1 / 0)):double>
 
 
 -- !query
-SELECT nanvl(1-0, 1/0) FROM t
+SELECT nanvl(1-0, 1/0) FROM conditional_t
 -- !query schema
 struct<nanvl((1 - 0), (1 / 0)):double>
 -- !query output
@@ -44,7 +44,7 @@ struct<nanvl((1 - 0), (1 / 0)):double>
 
 
 -- !query
-SELECT if(c2 >= 0, 1-0, 1/0) from t
+SELECT if(c2 >= 0, 1-0, 1/0) from conditional_t
 -- !query schema
 struct<(IF((c2 >= 0), (1 - 0), (1 / 0))):double>
 -- !query output
@@ -71,7 +71,7 @@ struct<(IF((NOT (1 = 1)), (1 / 0), 1)):double>
 
 
 -- !query
-SELECT coalesce(c2, 1/0) from t
+SELECT coalesce(c2, 1/0) from conditional_t
 -- !query schema
 struct<coalesce(c2, (1 / 0)):double>
 -- !query output
@@ -98,7 +98,7 @@ struct<coalesce(NULL, 1, (1 / 0)):double>
 
 
 -- !query
-SELECT case when c2 >= 0 then 1 else 1/0 end from t
+SELECT case when c2 >= 0 then 1 else 1/0 end from conditional_t
 -- !query schema
 struct<CASE WHEN (c2 >= 0) THEN 1 ELSE (1 / 0) END:double>
 -- !query output
@@ -125,7 +125,7 @@ struct<CASE WHEN (1 > 2) THEN (1 / 0) ELSE 1 END:double>
 
 
 -- !query
-DROP TABLE IF EXISTS t
+DROP TABLE conditional_t
 -- !query schema
 struct<>
 -- !query output


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org