Data input type is not recognised by InfluxDB 2.0

Hello, I am able to create the fileds in Influxdb 2.0, but not rable to read the data in it:

I used C# client @bednar .

It says ```
unsupported input type for mean aggregate: string

Here is my Input data type:

[Column(“ID”)] public byte ID { get; set; }

[Column(“Values”)] public Int16 Values { get; set; } = new short[4];

[Column(“Infos”)] public byte Infos { get; set; } = new byte[16];

[Column(“Reserve”)] public byte Reserve { get; set; }

[Column(“SensorValues”)] public short SensorValues { get; set; }

Please let me know how to read the data of my fileds.

Please show us a small sample of the actual data, and also the query you are
using the get data from the table (the query which produces the error message
you have quoted).


Sample data:




Binary('AAAAAAAA', 0)

Here I am writing the code in .Net:

 var sem = new BinaryTelegrams { ID = Binary'RjMtMTgwMCAxMDgxIDg4OCAvIFcyMDYgSEtMLUlOTkVOIEJQTC1PQkVOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...', 0),Values ={0,-2731,-2731,-2731}, Infos = Binary('AQEBAQICAgIAAAAAAAAAAA==', 0),Reserve =Binary('AAAAAAAA', 0)`,SensorValues = {1,-2,-500,400},{5,6,100}  };`

            using (var writeApi = influxDBClient.GetWriteApi())
                writeApi.WriteMeasurement(resource.Id, resource.OrgID, WritePrecision.Ns, sem);

@Nitesh the error you’re hitting:

unsupported input type for mean aggregate: string

Means that somewhere in one of your flux queries, you’re calling mean on a column/field with type string. This could be a bare mean() call or an aggregateWindow with fn: mean.

@dan-moran Thankyou so much for the reply :blush: :blush:

1 Like

@dan-moran, actually after removing the mean()` call or an `aggregateWindow` with `fn: mean .
I can read the data type in values but not able to see the values in it. I am geeting the value from 5 sensor and each Sensor has 206 value in it., Please let me know how to see the dataread1

@Nitesh based on that output, I’d say the code you’re using to write data is sending the literal string "System.Int16[][]" for your field value. You’ll need to update your write-side code to format your data properly as line protocol before sending it.

1 Like

Before sending I was using this property to have the array of data in this property, here it should show here sensor number and the values in it. (for example - > 1 - 45,47,78,12… ,->2 - 72,4,8,9… , → 3 - 5,77,48,49) but it just converted the data type from short[][] to System.Int16[][]

May be I have to use instead of short to some different data type but I am not able to find it. Also the the value is send to this influxdb database but instead of using the data value , I am only able to see the data type.

@Nitesh, @dan-moran is correct. Youre client isn’t writing the field value correctly. It’s writing the literal string System.Int16[][] as the field value.

1 Like

Thankyou for this point. I changed the data type in my code before sending to the database. I Send my data as a list and it worked fine.