File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -609,6 +609,9 @@ def _parse_query_parameter(self) -> t.Optional[exp.Expression]:
609609 elif not self ._match (TokenType .R_BRACE ):
610610 self .raise_error ("Expecting }" )
611611
612+ if isinstance (this , exp .Identifier ) and not this .quoted :
613+ this = exp .var (this .name )
614+
612615 return self .expression (exp .Placeholder , this = this , kind = kind )
613616
614617 def _parse_bracket (
Original file line number Diff line number Diff line change 33from sqlglot .dialects import ClickHouse
44from sqlglot .expressions import convert
55from sqlglot .optimizer import traverse_scope
6+ from sqlglot .optimizer .qualify_columns import quote_identifiers
67from tests .dialects .test_dialect import Validator
78from sqlglot .errors import ErrorLevel
89
@@ -11,6 +12,9 @@ class TestClickhouse(Validator):
1112 dialect = "clickhouse"
1213
1314 def test_clickhouse (self ):
15+ expr = quote_identifiers (self .parse_one ("{start_date:String}" ), dialect = "clickhouse" )
16+ self .assertEqual (expr .sql ("clickhouse" ), "{start_date: String}" )
17+
1418 for string_type_enum in ClickHouse .Generator .STRING_TYPE_MAPPING :
1519 self .validate_identity (f"CAST(x AS { string_type_enum .value } )" , "CAST(x AS String)" )
1620
You can’t perform that action at this time.
0 commit comments