File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -441,7 +441,7 @@ class BigQuery(Dialect):
441441 def normalize_identifier (self , expression : E ) -> E :
442442 if (
443443 isinstance (expression , exp .Identifier )
444- and self .normalization_strategy is self . NORMALIZATION_STRATEGY
444+ and self .normalization_strategy is NormalizationStrategy . CASE_INSENSITIVE
445445 ):
446446 parent = expression .parent
447447 while isinstance (parent , exp .Dot ):
Original file line number Diff line number Diff line change @@ -2387,5 +2387,16 @@ def test_annotate_timestamps(self):
23872387 def test_override_normalization_strategy (self ):
23882388 sql = "SELECT * FROM p.d.t"
23892389 ast = self .parse_one (sql )
2390- qualified = qualify (ast , dialect = "bigquery,normalization_strategy=uppercase" )
2390+ qualified = qualify (ast . copy () , dialect = "bigquery,normalization_strategy=uppercase" )
23912391 self .assertEqual (qualified .sql ("bigquery" ), "SELECT * FROM `P`.`D`.`T` AS `T`" )
2392+
2393+ from sqlglot .dialects import BigQuery
2394+ from sqlglot .dialects .dialect import NormalizationStrategy
2395+
2396+ try :
2397+ BigQuery .NORMALIZATION_STRATEGY = NormalizationStrategy .UPPERCASE
2398+
2399+ qualified = qualify (ast .copy (), dialect = "bigquery,normalization_strategy=uppercase" )
2400+ self .assertEqual (qualified .sql ("bigquery" ), "SELECT * FROM `P`.`D`.`T` AS `T`" )
2401+ finally :
2402+ BigQuery .NORMALIZATION_STRATEGY = NormalizationStrategy .CASE_INSENSITIVE
You can’t perform that action at this time.
0 commit comments