Skip to content

Commit

Permalink
Fix: array with method calls
Browse files Browse the repository at this point in the history
  • Loading branch information
tobymao committed May 2, 2023
1 parent 94fed8c commit 52ab03d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sqlglot/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2793,15 +2793,14 @@ def _parse_types(self, check_func: bool = False) -> t.Optional[exp.Expression]:
if is_struct:
expressions = self._parse_csv(self._parse_struct_kwargs)
elif nested:
expressions = self._parse_csv(lambda: self._parse_types() or self._parse_bitwise())
expressions = self._parse_csv(self._parse_types)
else:
expressions = self._parse_csv(self._parse_conjunction)

if not expressions:
if not expressions or not self._match(TokenType.R_PAREN):
self._retreat(index)
return None

self._match_r_paren()
maybe_func = True

if self._match_pair(TokenType.L_BRACKET, TokenType.R_BRACKET):
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/identity.sql
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ ARRAY()
ARRAY(1, 2)
ARRAY(time, foo)
ARRAY(foo, time)
ARRAY(LENGTH(waiter_name) > 0)
ARRAY_CONTAINS(x, 1)
EXTRACT(x FROM y)
EXTRACT(DATE FROM y)
Expand Down

0 comments on commit 52ab03d

Please sign in to comment.