HyukjinKwon commented on a change in pull request #25124: 
[SPARK-28282][SQL][PYTHON][TESTS] Convert and port 'inline-table.sql' into UDF 
test base
URL: https://github.com/apache/spark/pull/25124#discussion_r304730452
 
 

 ##########
 File path: 
sql/core/src/test/resources/sql-tests/inputs/udf/udf-inline-table.sql
 ##########
 @@ -0,0 +1,54 @@
+-- This test file was converted from intersect-all.sql.
+-- Note that currently registered UDF returns a string. So there are some 
differences, for instance
+-- in string cast within UDF in Scala and Python.
+
+-- single row, without table and column alias
+select * from values ("one", 1);
+
+-- single row, without column alias
+select * from values ("one", 1) as data;
+
+-- single row
+select udf(a), b from values ("one", 1) as data(a, b);
+
+-- single column multiple rows
+select udf(a) from values 1, 2, 3 as data(a);
+
+-- three rows
+select udf(a), b from values ("one", 1), ("two", 2), ("three", null) as 
data(a, b);
+
+-- null type
+select udf(a), b from values ("one", null), ("two", null) as data(a, b);
+
+-- int and long coercion
+select udf(a), b from values ("one", 1), ("two", 2L) as data(a, b);
+
+-- foldable expressions
+select udf(a), udf(b) from values ("one", 1 + 0), ("two", 1 + 3L) as data(a, 
b);
 
 Review comment:
   I would test `udf(udf(a))` 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