diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 02:50:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 02:50:21 +0000 |
commit | da8fc943704a221b86f0f6938f4131f0dd679f82 (patch) | |
tree | bef7144499ea444319403ba8dbf68480ae3a4e39 /tests/test_optimizer.py | |
parent | Adding upstream version 23.10.0. (diff) | |
download | sqlglot-upstream/23.12.1.tar.xz sqlglot-upstream/23.12.1.zip |
Adding upstream version 23.12.1.upstream/23.12.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_optimizer.py')
-rw-r--r-- | tests/test_optimizer.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_optimizer.py b/tests/test_optimizer.py index c0b362c..758b60c 100644 --- a/tests/test_optimizer.py +++ b/tests/test_optimizer.py @@ -229,6 +229,17 @@ class TestOptimizer(unittest.TestCase): @patch("sqlglot.generator.logger") def test_qualify_columns(self, logger): self.assertEqual( + optimizer.qualify.qualify( + parse_one( + "SELECT `my_db.my_table`.`my_column` FROM `my_db.my_table`", + read="bigquery", + ), + dialect="bigquery", + ).sql(dialect="bigquery"), + "SELECT `my_table`.`my_column` AS `my_column` FROM `my_db.my_table` AS `my_table`", + ) + + self.assertEqual( optimizer.qualify_columns.qualify_columns( parse_one( "WITH RECURSIVE t AS (SELECT 1 AS x UNION ALL SELECT x + 1 FROM t AS child WHERE x < 10) SELECT * FROM t" |