loadstat_agg
ENGINE = AggregatingMergeTree(date, (host, date), 8192) POPULATE AS
SELECT
host,
date,
countState() AS hitCount,
countState(if(load = 0, host, NULL)) AS badCount,
uniqState(ip) AS hostCount,
uniqState(host) AS siteCount,
uniqState(userAgent) AS uniqCount,
avgState(
if(
((resolved - opened) > 0)
AND ((resolved - opened) <= 60000),
resolved - opened,
NULL
) / 1000
) AS avgLoadTime
FROM
loadstat
GROUP BY
host,
date
Ругается:
Code: 62, e.displayText() = DB::Exception: Syntax error: failed at position 99 (line 2, col 1): ENGINE = AggregatingMergeTree(date, (host, date), 8192) POPULATE AS
SELECT
host,
date,
countState() AS hitCount,
countState(if(load = 0, host, NULL)) AS. Expected one of: token, OpeningRoundBracket, AS, e.what() = DB::Exception
Что не так?
Ответил на гитхабе. Если целевая таблица уже есть то матвью не нужны параметры движка для создания .inner таблицы.
Обсуждают сегодня