InfluxDB - How to retain TAG Keys without grouping with SELECT .. INTO query

influxdb
#1

Hi,

I am trying to retain all the TAG keys from source measurement to destination but do not want to group them

When i run the SELECT … INTO to extract max() and group by time(1m), it just put the data without any TAG Keeys. for e.g.

SELECT max(“exch_to_fh”) AS “exch_to_fh” INTO “historical”.“historicalRetention”.max1min_historical FROM “testdb”.“autogen”.feedLatency_test GROUP BY time(1m)
name: result
time written


1970-01-01T00:00:00Z 1142

show tag keys from max1min_historical

As you can see above, it has written 1142 points, which is what i expect, but no TAG keys are retained. However, in order to retain all the TAG KEYS, i used the following that i found from Internet, i.e. group by time(1m), *

SELECT max(“exch_to_fh”) AS “exch_to_fh” INTO “historical”.“historicalRetention”.max1min_historical FROM “testdb”.“autogen”.feedLatency_test GROUP BY time(1m),*

name: result
time written


1970-01-01T00:00:00Z 873548

show tag keys from max1min_historical
name: max1min_historical
tagKey


event
feed
market
region
seqNo
source
symbol

But with the above, although it has retained all the TAG Keys as required, but it has grouped them all and the number of data point it has written (huge) is not as expected, it did not group by just time. Basically, i just need the GROUP by time(1m) and not for all the TAG keys but just retained the relevant TAG Keys for the time.

Appreciate any help with this.

thanks

ilyas

#2

Appreciate if somebody can look into this and advice. thanks