You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FORMATTING] ClickHouse: aggregate functions with combinators (countMerge, sumIf, ...) get a space before the parenthesis #990
SELECT sumIf(x, y >1), countMerge(s), uniqExactIfState(id), groupArrayArray(a) FROM t
Options: { language: 'clickhouse' }
Expected Output
SELECT
sumIf(x, y >1),
countMerge(s),
uniqExactIfState(id),
groupArrayArray(a)
FROM
t
Actual Output
SELECT
sumIf (x, y >1),
countMerge (s),
uniqExactIfState (id),
groupArrayArray (a)
FROM
t
Usage
format(sql, { language: 'clickhouse' })
ClickHouse. The function list of the dialect comes from system.functions, which does not contain the names ClickHouse builds from an aggregate function and a combinator (-If, -State, -Merge, ...). They are treated as identifiers, so they get a space before the parenthesis, unlike sum(x). They are common in materialized views and queries on AggregatingMergeTree tables.
Activity
MunMunMiao commentedon Oct 14, 2026
Closing for now: I'm going to handle the formatting on my side instead. Thanks for the library.