For a query like
facts[name, count(value)] {
certname ~ "^pe.*"
group by name
}
The query engine currently constructs an SQL SELECT that looks like
SELECT fs.key AS name,
count((value#>>'{}')::numeric) count
Which causes the error
javax.servlet.ServletException: org.postgresql.util.PSQLException: ERROR: invalid input syntax for type numeric: "root"
But the argument to count is invalid and it should be closer to
count(value) count
NOTE: The error will only happen if the table has data.