I recently upgraded my grafana from v8.5.6-1 to v11.0.0-1 and lost my alert rules.
I am now re-creating them and I am having some problems adding an alert rule, where I get the following error:
[sse.dataQueryError] failed to execute query [A]: Code: 46. DB::Exception: Unknown function toDATE. Maybe you meant: ['toDate','toDate32']: While processing SELECT (intDiv(toUInt32(record_datetime), 1800) * 1800) * 1000 AS t, avg(mos) FROM hepic_data.sip_transaction_call WHERE (record_datetime >= toDateTime(1717420888)) AND (record_datetime <= toDateTime(1718025688)) AND (captid IN (9174, 9174)) AND (mos > toDATE(1718025688)) AND (duration > toDATE(1718025688)) GROUP BY t ORDER BY t ASC LIMIT 5000. (UNKNOWN_FUNCTION) (version 21.9.4.35 (official build))
Here is the original query:
SELECT
$timeSeries as t,
avg(mos)
FROM $table
WHERE
$timeFilter
AND captid in (9174,9174) AND mos > 1 AND duration > 1
GROUP BY
t
ORDER BY t
LIMIT 5000
It seems to be trying to convert certain integers to date using ‘toDATE()’
The Data source is a Clickhouse Database and I am using Grafana version 11.0.0
SELECT $timeSeries as time,
avg(mos) as value
FROM $table
WHERE $timeFilter
AND captid in (9174,9174)
AND mos > 1
AND duration > 1
GROUP BY 1
ORDER BY 1
LIMIT 5000
are there functions to make mos > int16(1) otherwise as you can see it is converting that 1 to toDate() you need to fix that so that it does not convert it to date, that is your issue. could be a bug in the clickhouse plugin. you have not yet explained why it does that odd conversion