diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-01-23 08:42:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-01-23 08:42:55 +0000 |
commit | ade4a78e8fabcaa7270b6d4be2187457a3fa115f (patch) | |
tree | 018225e76010479b3a568bb6d9ef5df457802885 /tests/dialects/test_teradata.py | |
parent | Adding upstream version 10.5.2. (diff) | |
download | sqlglot-ade4a78e8fabcaa7270b6d4be2187457a3fa115f.tar.xz sqlglot-ade4a78e8fabcaa7270b6d4be2187457a3fa115f.zip |
Adding upstream version 10.5.6.upstream/10.5.6
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.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/dialects/test_teradata.py b/tests/dialects/test_teradata.py new file mode 100644 index 0000000..e56de25 --- /dev/null +++ b/tests/dialects/test_teradata.py @@ -0,0 +1,23 @@ +from tests.dialects.test_dialect import Validator + + +class TestTeradata(Validator): + dialect = "teradata" + + def test_translate(self): + self.validate_all( + "TRANSLATE(x USING LATIN_TO_UNICODE)", + write={ + "teradata": "CAST(x AS CHAR CHARACTER SET UNICODE)", + }, + ) + self.validate_identity("CAST(x AS CHAR CHARACTER SET UNICODE)") + + def test_update(self): + self.validate_all( + "UPDATE A FROM schema.tableA AS A, (SELECT col1 FROM schema.tableA GROUP BY col1) AS B SET col2 = '' WHERE A.col1 = B.col1", + write={ + "teradata": "UPDATE A FROM schema.tableA AS A, (SELECT col1 FROM schema.tableA GROUP BY col1) AS B SET col2 = '' WHERE A.col1 = B.col1", + "mysql": "UPDATE A SET col2 = '' FROM schema.tableA AS A, (SELECT col1 FROM schema.tableA GROUP BY col1) AS B WHERE A.col1 = B.col1", + }, + ) |