Skip to main content
err:user:bad_request:invalid_analytics_function
Your analytics query uses a function we don’t allow. You get HTTP 400, and detail names the function.
Example response

Likely causes

  • You used toUnixTimestamp. The tables store milliseconds, so use toUnixTimestamp64Milli.
  • You used a JSONExtract* variant other than JSONExtractString.
  • You used a window function. They aren’t allowed.
  • You used a table function such as url, file, or remote. These get their own message.
These functions are allowed (names aren’t case-sensitive):
  • Aggregates: count, sum, avg, min, max, any, groupArray, groupUniqArray, uniq, uniqExact, quantile.
  • Date and time: now, now64, today, toDate, toDateTime, toDateTime64, the toStartOf* family from minute to year, date_trunc, formatDateTime, fromUnixTimestamp64Milli, toUnixTimestamp64Milli, and the toInterval* 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

  1. Rewrite the expression with an allowed function: toUnixTimestamp64Milli for toUnixTimestamp, JSONExtractString for other JSONExtract* variants, and a GROUP BY with an aggregate instead of a window function.
  2. If you need a function that’s missing, ask in Discord or open an issue.
Last modified on October 6, 2026