diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-12-24 07:49:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-12-24 07:49:56 +0000 |
commit | 97144fb2271b9bd749deac2eb3537103d9513182 (patch) | |
tree | ebd8aa8769becb97f7477cf9c14889146e6b8614 /tests/dialects/test_dialect.py | |
parent | Adding upstream version 20.3.0. (diff) | |
download | sqlglot-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.py | 37 |
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()", + }, + ) |