Type inconsistency?

I have a database with measurements where each field is stored as an integers (show field keys shows fieldType integer). I want to process these with a go UDF. I wrote a simpel batch script that just queries all data (select * from…) and forwards them to the UDF function (no other processing done in the tick script). In the UDF handler, the fields are received in Double fields, not in Int fields as I would expect. Why is this? Is it a bug? To me it seems very inconsistent to process known integer fields as doubles. Actually, it took me quite a while to figure out what was going on here. I suspect a bug. If not, could anyone please explain me the logic behind this?

@HansKe At the moment integers are only supported in stream tasks. The reason for this is that batch tasks are just InfluxDB queries that return JSON and JSON doesn’t have integer support, so all numeric data in batch tasks ends up being floats.

This is a known issue and cannot be resolved in Kapacitor until it is resolved in InfluxDB. For more information in the issue see influxdb#8330.

1 Like

Another related issue: Kapacitor record query converts integer to float · Issue #1338 · influxdata/kapacitor · GitHub

Hi Michael,

Thanks for this information.

In my opinion the design limitations are a real hindrance. As described in the issues you point out, what is needed is a efficient and accurate protocols, optimized for fast processing and low memory consumption. I sincerely hope influxdata will endorse these standpoints and come up with a solution for its users sooner rather than later. As I am sure you will.

Thanks again for providing an answer to my question at short notice!

I couldn’t agree more. :slight_smile:

1 Like