err:user:bad_request:invalid_analytics_functiondetail names the function.
Example response
Likely causes
- You used
toUnixTimestamp. The tables store milliseconds, so usetoUnixTimestamp64Milli. - You used a
JSONExtract*variant other thanJSONExtractString. - You used a window function. They aren’t allowed.
- You used a table function such as
url,file, orremote. These get their own message.
- Aggregates:
count,sum,avg,min,max,any,groupArray,groupUniqArray,uniq,uniqExact,quantile. - Date and time:
now,now64,today,toDate,toDateTime,toDateTime64, thetoStartOf*family from minute to year,date_trunc,formatDateTime,fromUnixTimestamp64Milli,toUnixTimestamp64Milli, and thetoInterval*family. - Strings:
lower,upper,substring,concat,length,trim,startsWith,endsWith. - JSON:
JSONExtractString. - Math:
round,floor,ceil,abs. - Conditionals:
if,sumIf,countIf,case,coalesce. - Conversions:
toString,toInt32,toInt64,toFloat64. - Arrays:
has,hasAny,hasAll,arrayJoin,arrayFilter.
How to fix
- Rewrite the expression with an allowed function:
toUnixTimestamp64MillifortoUnixTimestamp,JSONExtractStringfor otherJSONExtract*variants, and aGROUP BYwith an aggregate instead of a window function. - If you need a function that’s missing, ask in Discord or open an issue.
Related errors
err:user:bad_request:invalid_analytics_query: the query failed for another structural reason.err:user:bad_request:invalid_analytics_table: the query names a table that isn’t exposed.