summaryrefslogtreecommitdiffstats
path: root/tests/test_optimizer.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 20:07:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 20:07:58 +0000
commitfc2b129d31cbb474bbebfa0baa8537238f6332ed (patch)
tree5c6055c1be787787ae2d13b144f280740e235f79 /tests/test_optimizer.py
parentAdding upstream version 24.0.0. (diff)
downloadsqlglot-fc2b129d31cbb474bbebfa0baa8537238f6332ed.tar.xz
sqlglot-fc2b129d31cbb474bbebfa0baa8537238f6332ed.zip
Adding upstream version 24.1.0.upstream/24.1.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_optimizer.py')
-rw-r--r--tests/test_optimizer.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_optimizer.py b/tests/test_optimizer.py
index 36768f8..7ec0872 100644
--- a/tests/test_optimizer.py
+++ b/tests/test_optimizer.py
@@ -317,6 +317,18 @@ class TestOptimizer(unittest.TestCase):
'WITH "t" AS (SELECT 1 AS "c") (SELECT "t"."c" AS "c" FROM "t" AS "t")',
)
+ self.assertEqual(
+ optimizer.qualify_columns.qualify_columns(
+ parse_one(
+ "WITH tbl1 AS (SELECT STRUCT(1 AS `f0`, 2 as f1) AS col) SELECT tbl1.col.* from tbl1",
+ dialect="bigquery",
+ ),
+ schema=MappingSchema(schema=None, dialect="bigquery"),
+ infer_schema=False,
+ ).sql(dialect="bigquery"),
+ "WITH tbl1 AS (SELECT STRUCT(1 AS `f0`, 2 AS f1) AS col) SELECT tbl1.col.`f0` AS `f0`, tbl1.col.f1 AS f1 FROM tbl1",
+ )
+
self.check_file(
"qualify_columns", qualify_columns, execute=True, schema=self.schema, set_dialect=True
)