user_D_A__
user_D_A__

Reputation: 460

InfluxQL : Influx DB conversion of a field from String to integer

I am new to InfluxDB. I have filled the influx measurements with time series data

I have the following measurement point

time,host,interface,value
2/11/2019 12:03:08 AM,XYZ_test ,gigabitethernet8/43,"292724"

the value is in the form of String I need to use InfluxQL to convert the column to Integer or float , how to do it ?

Upvotes: 5

Views: 23856

Answers (1)

Lawliet
Lawliet

Reputation: 1592

Using this you should be able to cast the values from float to integer.

SELECT column_name::integer FROM table_name

You can refer to the InfluxDB docs here,

https://docs.influxdata.com/influxdb/v1.7/query_language/data_exploration/#cast-float-field-values-to-integers

Edit: But, however, there is no support for converting a string to an integer.

Upvotes: 5

Related Questions