Being new to influxdb I copied a measurement with SELECT INTO but did not appreciate the need to add the GROUP BY clause to keep the ‘location’ tag as a tag rather than a field key.
Since then more data has been written with ‘location’ correctly as a tag with the result that my data set is a mess with the older data having ‘location’ as a field key.
I’ve tried copying out to a new data set using two selects:
SELECT location::field, xyz INTO destination WHERE location::field != ‘’ GROUP by location
SELECT location::tag, xyz INTO destination WHERE location::tag !- ‘’ GROUP by location
But I then just get location and location_1 as ‘columns’ in the data set.
I can basically find no way to recover from this mess ie get all of the locations whether they exist as tags or field keys in the source data set, into one tag key set in the new data.
Anyone care to explain how to do this? Really finding influxdb a nightmare to use to be honest…