diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 02:50:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 02:50:21 +0000 |
commit | da8fc943704a221b86f0f6938f4131f0dd679f82 (patch) | |
tree | bef7144499ea444319403ba8dbf68480ae3a4e39 /tests/dialects/test_duckdb.py | |
parent | Adding upstream version 23.10.0. (diff) | |
download | sqlglot-upstream/23.12.1.tar.xz sqlglot-upstream/23.12.1.zip |
Adding upstream version 23.12.1.upstream/23.12.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_duckdb.py')
-rw-r--r-- | tests/dialects/test_duckdb.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/dialects/test_duckdb.py b/tests/dialects/test_duckdb.py index 0b13a70..9105a49 100644 --- a/tests/dialects/test_duckdb.py +++ b/tests/dialects/test_duckdb.py @@ -652,8 +652,14 @@ class TestDuckDB(Validator): "SELECT CAST('2020-05-06' AS DATE) + INTERVAL 5 DAY", read={"bigquery": "SELECT DATE_ADD(CAST('2020-05-06' AS DATE), INTERVAL 5 DAY)"}, ) - self.validate_identity("SELECT PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY y DESC) FROM t") - self.validate_identity("SELECT PERCENTILE_DISC(0.25) WITHIN GROUP (ORDER BY y DESC) FROM t") + self.validate_identity( + "SELECT PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY y DESC) FROM t", + "SELECT QUANTILE_CONT(y, 0.25 ORDER BY y DESC) FROM t", + ) + self.validate_identity( + "SELECT PERCENTILE_DISC(0.25) WITHIN GROUP (ORDER BY y DESC) FROM t", + "SELECT QUANTILE_DISC(y, 0.25 ORDER BY y DESC) FROM t", + ) self.validate_all( "SELECT QUANTILE_CONT(x, q) FROM t", write={ @@ -1075,6 +1081,15 @@ class TestDuckDB(Validator): write={ "snowflake": "ALTER TABLE db.t1 RENAME TO db.t2", "duckdb": "ALTER TABLE db.t1 RENAME TO t2", + "tsql": "EXEC sp_rename 'db.t1', 't2'", + }, + ) + self.validate_all( + 'ALTER TABLE "db"."t1" RENAME TO "db"."t2"', + write={ + "snowflake": 'ALTER TABLE "db"."t1" RENAME TO "db"."t2"', + "duckdb": 'ALTER TABLE "db"."t1" RENAME TO "t2"', + "tsql": "EXEC sp_rename '[db].[t1]', 't2'", }, ) |