diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-03-08 07:22:12 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-03-08 07:22:12 +0000 |
commit | 243d9a15edd910136313a7a9fa7d7f24b494e169 (patch) | |
tree | 22d768ca708dc5caa8230705a9155ba1a343502b /tests/test_optimizer.py | |
parent | Adding upstream version 11.3.0. (diff) | |
download | sqlglot-243d9a15edd910136313a7a9fa7d7f24b494e169.tar.xz sqlglot-243d9a15edd910136313a7a9fa7d7f24b494e169.zip |
Adding upstream version 11.3.3.upstream/11.3.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_optimizer.py')
-rw-r--r-- | tests/test_optimizer.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_optimizer.py b/tests/test_optimizer.py index 8ddd95f..e10d05e 100644 --- a/tests/test_optimizer.py +++ b/tests/test_optimizer.py @@ -364,6 +364,11 @@ FROM READ_CSV('tests/fixtures/optimizer/tpc-h/nation.csv.gz', 'delimiter', '|') expression = annotate_types(parse_one("ARRAY(1)::ARRAY<INT>")) self.assertEqual(expression.type, parse_one("ARRAY<INT>", into=exp.DataType)) + expression = annotate_types(parse_one("CAST(x AS INTERVAL)")) + self.assertEqual(expression.type.this, exp.DataType.Type.INTERVAL) + self.assertEqual(expression.this.type.this, exp.DataType.Type.UNKNOWN) + self.assertEqual(expression.args["to"].type.this, exp.DataType.Type.INTERVAL) + def test_cache_annotation(self): expression = annotate_types( parse_one("CACHE LAZY TABLE x OPTIONS('storageLevel' = 'value') AS SELECT 1") |