Skip to content

Commit

Permalink
Fix: count with multiple args closes #1755
Browse files Browse the repository at this point in the history
  • Loading branch information
tobymao committed Jun 12, 2023
1 parent cdd814f commit 1553bfa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sqlglot/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3934,7 +3934,8 @@ class ConcatWs(Concat):


class Count(AggFunc):
arg_types = {"this": False}
arg_types = {"this": False, "expressions": False}
is_var_len_args = True


class CountIf(AggFunc):
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/identity.sql
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ DATE(x) = DATE(y)
TIMESTAMP(DATE(x))
TIMESTAMP_TRUNC(COALESCE(time_field, CURRENT_TIMESTAMP()), DAY)
COUNT(DISTINCT CASE WHEN DATE_TRUNC(DATE(time_field), isoweek) = DATE_TRUNC(DATE(time_field2), isoweek) THEN report_id ELSE NULL END)
COUNT(a, b)
x[y - 1]
CASE WHEN SUM(x) > 3 THEN 1 END OVER (PARTITION BY x)
SUM(ROW() OVER (PARTITION BY x))
Expand Down

0 comments on commit 1553bfa

Please sign in to comment.