aboutsummaryrefslogtreecommitdiff
path: root/sql/core/src/test/resources/sql-tests/inputs
diff options
context:
space:
mode:
authorEric Liang <ekl@databricks.com>2016-08-18 13:33:55 +0200
committerHerman van Hovell <hvanhovell@databricks.com>2016-08-18 13:33:55 +0200
commit412dba63b511474a6db3c43c8618d803e604bc6b (patch)
tree2247e6674c4a49a934b98b27fd8a2d7ff7d177dc /sql/core/src/test/resources/sql-tests/inputs
parentb81421afb04959bb22b53653be0a09c1f1c5845f (diff)
downloadspark-412dba63b511474a6db3c43c8618d803e604bc6b.tar.gz
spark-412dba63b511474a6db3c43c8618d803e604bc6b.tar.bz2
spark-412dba63b511474a6db3c43c8618d803e604bc6b.zip
[SPARK-17069] Expose spark.range() as table-valued function in SQL
## What changes were proposed in this pull request? This adds analyzer rules for resolving table-valued functions, and adds one builtin implementation for range(). The arguments for range() are the same as those of `spark.range()`. ## How was this patch tested? Unit tests. cc hvanhovell Author: Eric Liang <ekl@databricks.com> Closes #14656 from ericl/sc-4309.
Diffstat (limited to 'sql/core/src/test/resources/sql-tests/inputs')
-rw-r--r--sql/core/src/test/resources/sql-tests/inputs/table-valued-functions.sql20
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/core/src/test/resources/sql-tests/inputs/table-valued-functions.sql b/sql/core/src/test/resources/sql-tests/inputs/table-valued-functions.sql
new file mode 100644
index 0000000000..2e6dcd538b
--- /dev/null
+++ b/sql/core/src/test/resources/sql-tests/inputs/table-valued-functions.sql
@@ -0,0 +1,20 @@
+-- unresolved function
+select * from dummy(3);
+
+-- range call with end
+select * from range(6 + cos(3));
+
+-- range call with start and end
+select * from range(5, 10);
+
+-- range call with step
+select * from range(0, 10, 2);
+
+-- range call with numPartitions
+select * from range(0, 10, 1, 200);
+
+-- range call error
+select * from range(1, 1, 1, 1, 1);
+
+-- range call with null
+select * from range(1, null);