summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_teradata.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-19 13:44:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-19 13:44:59 +0000
commitef2db38de92f2329c1c366318bddfc7e3dee8415 (patch)
treedee41de1eb0e05f2f6805b77df41a71b3aa66ec2 /tests/dialects/test_teradata.py
parentAdding upstream version 11.0.1. (diff)
downloadsqlglot-upstream/11.1.3.tar.xz
sqlglot-upstream/11.1.3.zip
Adding upstream version 11.1.3.upstream/11.1.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/dialects/test_teradata.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/dialects/test_teradata.py b/tests/dialects/test_teradata.py
index 9e82961..ab87eef 100644
--- a/tests/dialects/test_teradata.py
+++ b/tests/dialects/test_teradata.py
@@ -24,3 +24,41 @@ class TestTeradata(Validator):
def test_create(self):
self.validate_identity("CREATE TABLE x (y INT) PRIMARY INDEX (y) PARTITION BY y INDEX (y)")
+
+ self.validate_all(
+ "REPLACE VIEW a AS (SELECT b FROM c)",
+ write={"teradata": "CREATE OR REPLACE VIEW a AS (SELECT b FROM c)"},
+ )
+
+ self.validate_all(
+ "SEL a FROM b",
+ write={"teradata": "SELECT a FROM b"},
+ )
+
+ def test_insert(self):
+ self.validate_all(
+ "INS INTO x SELECT * FROM y", write={"teradata": "INSERT INTO x SELECT * FROM y"}
+ )
+
+ def test_mod(self):
+ 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"})
+
+ def test_datatype(self):
+ self.validate_all(
+ "CREATE TABLE z (a ST_GEOMETRY(1))",
+ write={
+ "teradata": "CREATE TABLE z (a ST_GEOMETRY(1))",
+ "redshift": "CREATE TABLE z (a GEOMETRY(1))",
+ },
+ )
+
+ self.validate_identity("CREATE TABLE z (a SYSUDTLIB.INT)")