summaryrefslogtreecommitdiffstats
path: root/tests/test_optimizer.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-12 06:15:45 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-12 06:15:45 +0000
commit2d4657dbba42ff38ad3db64e494a9cf89df98c07 (patch)
treeaf0b12a888fe75ab863e2ecc52e1bf95f25f7f30 /tests/test_optimizer.py
parentReleasing debian version 21.0.1-1. (diff)
downloadsqlglot-2d4657dbba42ff38ad3db64e494a9cf89df98c07.tar.xz
sqlglot-2d4657dbba42ff38ad3db64e494a9cf89df98c07.zip
Merging upstream version 21.0.2.
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 d0ef8aa..0e8a803 100644
--- a/tests/test_optimizer.py
+++ b/tests/test_optimizer.py
@@ -980,6 +980,12 @@ FROM READ_CSV('tests/fixtures/optimizer/tpc-h/nation.csv.gz', 'delimiter', '|')
self.assertEqual(expression.selects[0].type.sql(dialect="bigquery"), "STRUCT<`f` STRING>")
+ expression = annotate_types(
+ parse_one("SELECT unnest(t.x) FROM t AS t", dialect="postgres"),
+ schema={"t": {"x": "array<int>"}},
+ )
+ self.assertTrue(expression.selects[0].is_type("int"))
+
def test_type_annotation_cache(self):
sql = "SELECT 1 + 1"
expression = annotate_types(parse_one(sql))