From e5834b77e3e1f6129c354bbe4c74bec6bfec9a99 Mon Sep 17 00:00:00 2001 From: Yongting You <2010youy01@gmail.com> Date: Sat, 30 Nov 2024 15:24:36 +0800 Subject: [PATCH] test udf+udtf generate_series() in the same sql --- datafusion/sqllogictest/test_files/table_functions.slt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/datafusion/sqllogictest/test_files/table_functions.slt b/datafusion/sqllogictest/test_files/table_functions.slt index 878c129c4e97..12402e0d70c5 100644 --- a/datafusion/sqllogictest/test_files/table_functions.slt +++ b/datafusion/sqllogictest/test_files/table_functions.slt @@ -131,4 +131,12 @@ statement error DataFusion error: Error during planning: Second argument must be SELECT * FROM generate_series(1, '2') statement error DataFusion error: Error during planning: First argument must be an integer literal -SELECT * FROM generate_series('foo', 'bar') \ No newline at end of file +SELECT * FROM generate_series('foo', 'bar') + +# UDF and UDTF `generate_series` can be used simultaneously +query ? rowsort +SELECT generate_series(1, t1.end) FROM generate_series(3, 5) as t1(end) +---- +[1, 2, 3, 4, 5] +[1, 2, 3, 4] +[1, 2, 3] \ No newline at end of file