summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_dialect.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 16:50:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 16:50:34 +0000
commit7b2d028262d3e100dfc42b94bb705a09a5c7e93d (patch)
treea957a3e8fac83475e3652d4bae8cab896e6b22a6 /tests/dialects/test_dialect.py
parentReleasing debian version 25.20.1-1. (diff)
downloadsqlglot-7b2d028262d3e100dfc42b94bb705a09a5c7e93d.tar.xz
sqlglot-7b2d028262d3e100dfc42b94bb705a09a5c7e93d.zip
Merging upstream version 25.21.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_dialect.py')
-rw-r--r--tests/dialects/test_dialect.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/dialects/test_dialect.py b/tests/dialects/test_dialect.py
index f0faccb..19effb3 100644
--- a/tests/dialects/test_dialect.py
+++ b/tests/dialects/test_dialect.py
@@ -1788,6 +1788,13 @@ class TestDialect(Validator):
},
)
self.validate_all(
+ "FILTER(the_array, x -> x > 0)",
+ write={
+ "presto": "FILTER(the_array, x -> x > 0)",
+ "starrocks": "ARRAY_FILTER(the_array, x -> x > 0)",
+ },
+ )
+ self.validate_all(
"a / b",
write={
"bigquery": "a / b",
@@ -2853,3 +2860,34 @@ FROM subquery2""",
"bigquery": "RTRIM('Hello World', 'd')",
},
)
+
+ def test_uuid(self):
+ self.validate_all(
+ "UUID()",
+ read={
+ "hive": "UUID()",
+ "spark2": "UUID()",
+ "spark": "UUID()",
+ "databricks": "UUID()",
+ "duckdb": "UUID()",
+ "presto": "UUID()",
+ "trino": "UUID()",
+ "mysql": "UUID()",
+ "postgres": "GEN_RANDOM_UUID()",
+ "bigquery": "GENERATE_UUID()",
+ "snowflake": "UUID_STRING()",
+ },
+ write={
+ "hive": "UUID()",
+ "spark2": "UUID()",
+ "spark": "UUID()",
+ "databricks": "UUID()",
+ "duckdb": "UUID()",
+ "presto": "UUID()",
+ "trino": "UUID()",
+ "mysql": "UUID()",
+ "postgres": "GEN_RANDOM_UUID()",
+ "bigquery": "GENERATE_UUID()",
+ "snowflake": "UUID_STRING()",
+ },
+ )