summaryrefslogtreecommitdiffstats
path: root/tests/test_optimizer.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-16 05:45:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-16 05:45:49 +0000
commit87bb420e43bf31021b090be98143a32042255a46 (patch)
treef68baf119ccffb6ebc64ba066af1491ddcb0f121 /tests/test_optimizer.py
parentAdding upstream version 21.0.2. (diff)
downloadsqlglot-87bb420e43bf31021b090be98143a32042255a46.tar.xz
sqlglot-87bb420e43bf31021b090be98143a32042255a46.zip
Adding upstream version 21.1.1.upstream/21.1.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_optimizer.py')
-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"