summaryrefslogtreecommitdiffstats
path: root/tests/test_optimizer.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-16 05:45:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-16 05:45:52 +0000
commit3d48060515ba25b4c49d975a520ee0682327d1b7 (patch)
treee8730f509026e866d77c459f74a384505425363a /tests/test_optimizer.py
parentReleasing debian version 21.0.2-1. (diff)
downloadsqlglot-3d48060515ba25b4c49d975a520ee0682327d1b7.tar.xz
sqlglot-3d48060515ba25b4c49d975a520ee0682327d1b7.zip
Merging upstream version 21.1.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/test_optimizer.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_optimizer.py b/tests/test_optimizer.py
index 0e8a803..d4f2edb 100644
--- a/tests/test_optimizer.py
+++ b/tests/test_optimizer.py
@@ -874,6 +874,12 @@ FROM READ_CSV('tests/fixtures/optimizer/tpc-h/nation.csv.gz', 'delimiter', '|')
self.assertEqual(case_ifs_expr.type.this, exp.DataType.Type.VARCHAR)
self.assertEqual(case_ifs_expr.args["true"].type.this, exp.DataType.Type.VARCHAR)
+ timestamp = annotate_types(parse_one("TIMESTAMP(x)"))
+ self.assertEqual(timestamp.type.this, exp.DataType.Type.TIMESTAMP)
+
+ timestamptz = annotate_types(parse_one("TIMESTAMP(x)", read="bigquery"))
+ self.assertEqual(timestamptz.type.this, exp.DataType.Type.TIMESTAMPTZ)
+
def test_unknown_annotation(self):
schema = {"x": {"cola": "VARCHAR"}}
sql = "SELECT x.cola + SOME_ANONYMOUS_FUNC(x.cola) AS col FROM x AS x"