summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_teradata.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-11-01 05:12:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-11-01 05:12:38 +0000
commit613c2506f59fefeb0c0b921ca361c65e99458139 (patch)
treee1207c41ee9b35d77f1608e87e568fe60d701cf6 /tests/dialects/test_teradata.py
parentAdding upstream version 18.17.0. (diff)
downloadsqlglot-613c2506f59fefeb0c0b921ca361c65e99458139.tar.xz
sqlglot-613c2506f59fefeb0c0b921ca361c65e99458139.zip
Adding upstream version 19.0.1.upstream/19.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_teradata.py')
-rw-r--r--tests/dialects/test_teradata.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/tests/dialects/test_teradata.py b/tests/dialects/test_teradata.py
index b5c0fe8..14703c4 100644
--- a/tests/dialects/test_teradata.py
+++ b/tests/dialects/test_teradata.py
@@ -148,18 +148,21 @@ class TestTeradata(Validator):
self.validate_all("a MOD b", write={"teradata": "a MOD b", "mysql": "a % b"})
def test_abbrev(self):
- self.validate_all("a LT b", write={"teradata": "a < b"})
- self.validate_all("a LE b", write={"teradata": "a <= b"})
- self.validate_all("a GT b", write={"teradata": "a > b"})
- self.validate_all("a GE b", write={"teradata": "a >= b"})
- self.validate_all("a ^= b", write={"teradata": "a <> b"})
- self.validate_all("a NE b", write={"teradata": "a <> b"})
- self.validate_all("a NOT= b", write={"teradata": "a <> b"})
-
- self.validate_all(
- "SEL a FROM b",
- write={"teradata": "SELECT a FROM b"},
- )
+ self.validate_identity("a LT b", "a < b")
+ self.validate_identity("a LE b", "a <= b")
+ self.validate_identity("a GT b", "a > b")
+ self.validate_identity("a GE b", "a >= b")
+ self.validate_identity("a ^= b", "a <> b")
+ self.validate_identity("a NE b", "a <> b")
+ self.validate_identity("a NOT= b", "a <> b")
+ self.validate_identity("a EQ b", "a = b")
+ self.validate_identity("SEL a FROM b", "SELECT a FROM b")
+ self.validate_identity(
+ "SELECT col1, col2 FROM dbc.table1 WHERE col1 EQ 'value1' MINUS SELECT col1, col2 FROM dbc.table2",
+ "SELECT col1, col2 FROM dbc.table1 WHERE col1 = 'value1' EXCEPT SELECT col1, col2 FROM dbc.table2",
+ )
+ self.validate_identity("UPD a SET b = 1", "UPDATE a SET b = 1")
+ self.validate_identity("DEL FROM a", "DELETE FROM a")
def test_datatype(self):
self.validate_all(
@@ -187,3 +190,4 @@ class TestTeradata(Validator):
"": "STR_TO_DATE('1992-01', '%Y-%d')",
},
)
+ self.validate_identity("CAST('1992-01' AS FORMAT 'YYYY-DD')")