HyukjinKwon commented on a change in pull request #25202: 
[SPARK-28289][SQL][PYTHON][TESTS] Convert and port 'union.sql' into UDF test 
base
URL: https://github.com/apache/spark/pull/25202#discussion_r305656980
 
 

 ##########
 File path: sql/core/src/test/resources/sql-tests/inputs/udf/udf-union.sql
 ##########
 @@ -0,0 +1,56 @@
+-- This test file was converted from union.sql.
+
+CREATE OR REPLACE TEMPORARY VIEW t1 AS VALUES (1, 'a'), (2, 'b') tbl(c1, c2);
+CREATE OR REPLACE TEMPORARY VIEW t2 AS VALUES (1.0, 1), (2.0, 4) tbl(c1, c2);
+
+-- Simple Union
+SELECT *
+FROM   (SELECT * FROM t1
+        UNION ALL
+        SELECT * FROM t1);
+
+-- Type Coerced Union
+SELECT *
+FROM   (SELECT * FROM t1
+        UNION ALL
+        SELECT * FROM t2
+        UNION ALL
+        SELECT * FROM t2);
+
+-- Regression test for SPARK-18622
+SELECT udf(a) as a
 
 Review comment:
   I would try `udf(udf(a))` combination too

----------------------------------------------------------------
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]

Reply via email to