File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -6164,7 +6164,9 @@ def _parse_case(self) -> t.Optional[exp.Expression]:
61646164
61656165 def _parse_if (self ) -> t .Optional [exp .Expression ]:
61666166 if self ._match (TokenType .L_PAREN ):
6167- args = self ._parse_csv (self ._parse_assignment )
6167+ args = self ._parse_csv (
6168+ lambda : self ._parse_alias (self ._parse_assignment (), explicit = True )
6169+ )
61686170 this = self .validate_expression (exp .If .from_arg_list (args ), args )
61696171 self ._match_r_paren ()
61706172 else :
Original file line number Diff line number Diff line change @@ -245,6 +245,7 @@ def test_spark(self):
245245 "REFRESH TABLE t" ,
246246 )
247247
248+ self .validate_identity ("IF(cond, foo AS bar, bla AS baz)" )
248249 self .validate_identity ("any_value(col, true)" , "ANY_VALUE(col) IGNORE NULLS" )
249250 self .validate_identity ("first(col, true)" , "FIRST(col) IGNORE NULLS" )
250251 self .validate_identity ("first_value(col, true)" , "FIRST_VALUE(col) IGNORE NULLS" )
You can’t perform that action at this time.
0 commit comments