HyukjinKwon commented on a change in pull request #25090:
[SPARK-28278][SQL][PYTHON][TESTS] Convert and port 'except-all.sql' into UDF
test base
URL: https://github.com/apache/spark/pull/25090#discussion_r302323340
##########
File path:
sql/core/src/test/resources/sql-tests/results/udf/udf-except-all.sql.out
##########
@@ -0,0 +1,345 @@
+-- Automatically generated by SQLQueryTestSuite
+-- Number of queries: 27
+
+
+-- !query 0
+CREATE TEMPORARY VIEW tab1 AS SELECT * FROM VALUES
+ (0), (1), (2), (2), (2), (2), (3), (null), (null) AS tab1(c1)
+-- !query 0 schema
+struct<>
+-- !query 0 output
+
+
+
+-- !query 1
+CREATE TEMPORARY VIEW tab2 AS SELECT * FROM VALUES
+ (1), (2), (2), (3), (5), (5), (null) AS tab2(c1)
+-- !query 1 schema
+struct<>
+-- !query 1 output
+
+
+
+-- !query 2
+CREATE TEMPORARY VIEW tab3 AS SELECT * FROM VALUES
+ (1, 2),
+ (1, 2),
+ (1, 3),
+ (2, 3),
+ (2, 2)
+ AS tab3(k, v)
+-- !query 2 schema
+struct<>
+-- !query 2 output
+
+
+
+-- !query 3
+CREATE TEMPORARY VIEW tab4 AS SELECT * FROM VALUES
+ (1, 2),
+ (2, 3),
+ (2, 2),
+ (2, 2),
+ (2, 20)
+ AS tab4(k, v)
+-- !query 3 schema
+struct<>
+-- !query 3 output
+
+
+
+-- !query 4
+SELECT * FROM tab1
+EXCEPT ALL
+SELECT * FROM tab2
+-- !query 4 schema
+struct<c1:int>
+-- !query 4 output
+0
+2
+2
+NULL
+
+
+-- !query 5
+SELECT * FROM tab1
+MINUS ALL
+SELECT * FROM tab2
+-- !query 5 schema
+struct<c1:int>
+-- !query 5 output
+0
+2
+2
+NULL
+
+
+-- !query 6
+SELECT * FROM tab1
+EXCEPT ALL
+SELECT * FROM tab2 WHERE udf(c1) IS NOT NULL
+-- !query 6 schema
+struct<c1:int>
+-- !query 6 output
+0
+2
+2
+NULL
Review comment:
@imback82, can you check why there's this diff?
```diff
--- a/sql/core/src/test/resources/sql-tests/results/except-all.sql.out
+++
b/sql/core/src/test/resources/sql-tests/results/udf/udf-except-all.sql.out
@@ -77,7 +77,7 @@ NULL
-- !query 6
SELECT * FROM tab1
EXCEPT ALL
-SELECT * FROM tab2 WHERE c1 IS NOT NULL
+SELECT * FROM tab2 WHERE udf(c1) IS NOT NULL
-- !query 6 schema
struct<c1:int>
-- !query 6 output
@@ -85,11 +85,10 @@ struct<c1:int>
2
2
NULL
-NULL
```
I assume it's because udf convert `null` as a string `null` but it should
better to double check and clarify
----------------------------------------------------------------
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]