summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_dialect.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-24 07:49:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-24 07:49:56 +0000
commit97144fb2271b9bd749deac2eb3537103d9513182 (patch)
treeebd8aa8769becb97f7477cf9c14889146e6b8614 /tests/dialects/test_dialect.py
parentAdding upstream version 20.3.0. (diff)
downloadsqlglot-97144fb2271b9bd749deac2eb3537103d9513182.tar.xz
sqlglot-97144fb2271b9bd749deac2eb3537103d9513182.zip
Adding upstream version 20.4.0.upstream/20.4.0
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.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/dialects/test_dialect.py b/tests/dialects/test_dialect.py
index 49afc62..a49d067 100644
--- a/tests/dialects/test_dialect.py
+++ b/tests/dialects/test_dialect.py
@@ -2056,3 +2056,40 @@ SELECT
self.assertEqual(expression.sql(dialect="mysql"), expected_sql)
self.assertEqual(expression.sql(dialect="tsql"), expected_sql)
+
+ def test_random(self):
+ self.validate_all(
+ "RAND()",
+ write={
+ "bigquery": "RAND()",
+ "clickhouse": "randCanonical()",
+ "databricks": "RAND()",
+ "doris": "RAND()",
+ "drill": "RAND()",
+ "duckdb": "RANDOM()",
+ "hive": "RAND()",
+ "mysql": "RAND()",
+ "oracle": "RAND()",
+ "postgres": "RANDOM()",
+ "presto": "RAND()",
+ "spark": "RAND()",
+ "sqlite": "RANDOM()",
+ "tsql": "RAND()",
+ },
+ read={
+ "bigquery": "RAND()",
+ "clickhouse": "randCanonical()",
+ "databricks": "RAND()",
+ "doris": "RAND()",
+ "drill": "RAND()",
+ "duckdb": "RANDOM()",
+ "hive": "RAND()",
+ "mysql": "RAND()",
+ "oracle": "RAND()",
+ "postgres": "RANDOM()",
+ "presto": "RAND()",
+ "spark": "RAND()",
+ "sqlite": "RANDOM()",
+ "tsql": "RAND()",
+ },
+ )