vertica / vertica-grafana-datasource

Official Vertica datasource plugin for Grafana.
https://grafana.com/grafana/plugins/vertica-grafana-datasource/
Apache License 2.0
3 stars 9 forks source link

"Metric request error" if field contains a SQL NULL value #14

Closed bryanherger closed 2 years ago

bryanherger commented 2 years ago
  1. When using dashboard variable to select a Vertica-field name to select / group by: a. This functions as expected unless the Vertica field allows and contains any records w/ that field being null b. I can patch with a coalesce(fieldname,’0_UNKNOWN’) but I find that to be a hack and many queries were already stable using your previous unsigned version

test case: create a table and add a NULL varchar. Table fails to load unless metric is loaded with coalesce as shown. e.g.: -- fails to load with this row where v1 is VARCHAR dbadmin=> insert into vtest (ts, set, i1, v1) values (current_timestamp-interval '3 day', 4, 9, null); -- unless query is set to COALESCE on v1: SELECT ts AS "time", COALESCE(v1,'null') AS metric, set FROM public.vtest WHERE $__timeFilter(ts) ORDER BY 1,2