diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-23 11:12:26 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-23 11:12:26 +0000 |
commit | 6ea73443a6a81d2477f8eab80dcf1a9206a44d5e (patch) | |
tree | b44112413472fb48b734e74cc01ac1082c197c4c /tests/dialects/test_databricks.py | |
parent | Adding upstream version 25.5.1. (diff) | |
download | sqlglot-6ea73443a6a81d2477f8eab80dcf1a9206a44d5e.tar.xz sqlglot-6ea73443a6a81d2477f8eab80dcf1a9206a44d5e.zip |
Adding upstream version 25.6.1.upstream/25.6.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_databricks.py')
-rw-r--r-- | tests/dialects/test_databricks.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/dialects/test_databricks.py b/tests/dialects/test_databricks.py index 471830f..86612cc 100644 --- a/tests/dialects/test_databricks.py +++ b/tests/dialects/test_databricks.py @@ -98,6 +98,22 @@ class TestDatabricks(Validator): read="databricks", ) + self.validate_all( + "CREATE OR REPLACE FUNCTION func(a BIGINT, b BIGINT) RETURNS TABLE (a INT) RETURN SELECT a", + write={ + "databricks": "CREATE OR REPLACE FUNCTION func(a BIGINT, b BIGINT) RETURNS TABLE (a INT) RETURN SELECT a", + "duckdb": "CREATE OR REPLACE FUNCTION func(a, b) AS TABLE SELECT a", + }, + ) + + self.validate_all( + "CREATE OR REPLACE FUNCTION func(a BIGINT, b BIGINT) RETURNS BIGINT RETURN a", + write={ + "databricks": "CREATE OR REPLACE FUNCTION func(a BIGINT, b BIGINT) RETURNS BIGINT RETURN a", + "duckdb": "CREATE OR REPLACE FUNCTION func(a, b) AS a", + }, + ) + # https://docs.databricks.com/sql/language-manual/functions/colonsign.html def test_json(self): self.validate_identity("SELECT c1:price, c1:price.foo, c1:price.bar[1]") |