Column metric must be of type UNKNOWN, TEXT, VARCHAR, CHAR. metric column name: metric type: INT4 but datatype is int64

hi,
i’m trying to create pie chart for showing traffic based on port number.
but i’m getting this error

how can i fix this?


problem solved by changing the above query to this:

select
now() AS “time”,
sum(bytes),
cast(port_dst as text) as “metric”
from acct_v9
where ip_dst = ‘192.168.1.217’ AND stamp_updated >= now() - interval ‘10 minute’
group by 1 , port_dst
order by sum(bytes) DESC
limit 5;

1 Like