summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_dialect.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 02:50:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 02:50:21 +0000
commitda8fc943704a221b86f0f6938f4131f0dd679f82 (patch)
treebef7144499ea444319403ba8dbf68480ae3a4e39 /tests/dialects/test_dialect.py
parentAdding upstream version 23.10.0. (diff)
downloadsqlglot-da8fc943704a221b86f0f6938f4131f0dd679f82.tar.xz
sqlglot-da8fc943704a221b86f0f6938f4131f0dd679f82.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_dialect.py')
-rw-r--r--tests/dialects/test_dialect.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/dialects/test_dialect.py b/tests/dialects/test_dialect.py
index 691beb9..ea38521 100644
--- a/tests/dialects/test_dialect.py
+++ b/tests/dialects/test_dialect.py
@@ -2426,3 +2426,18 @@ FROM c""",
"""CREATE TEMPORARY SEQUENCE seq START WITH = 1 INCREMENT BY = 2""",
"""CREATE TEMPORARY SEQUENCE seq START WITH 1 INCREMENT BY 2""",
)
+
+ def test_reserved_keywords(self):
+ order = exp.select("*").from_("order")
+
+ for dialect in ("presto", "redshift"):
+ dialect = Dialect.get_or_raise(dialect)
+ self.assertEqual(
+ order.sql(dialect=dialect),
+ f"SELECT * FROM {dialect.IDENTIFIER_START}order{dialect.IDENTIFIER_END}",
+ )
+
+ self.validate_identity(
+ """SELECT partition.d FROM t PARTITION (d)""",
+ """SELECT partition.d FROM t AS PARTITION(d)""",
+ )