sarbo
sarbo

Reputation: 1691

Copy from a measurement to another measurement in InfluxDB

Having the following statement:

SELECT * INTO ZZZD FROM P4978

Output:

result
time                    written
1970-01-01T00:00:00Z    231

Using:

SELECT * FROM ZZZD 

I get only 7 lines even if there where 231 lines written. I can't figure why there are only 7 lines. Is there some setting or this is a defect? I'm not able to copy from a measurement to another measurement more than 7 lines.

Upvotes: 6

Views: 15029

Answers (3)

Rodrigo Estebanez
Rodrigo Estebanez

Reputation: 867

If you want an exact copy use:

SELECT * INTO ZZZD FROM P4978 group by *

If you don't specify group by *, the tags will turn into fields.

You can verify the tags with show tag keys from ZZZD and the fields with show field keys from ZZZD

Source: https://docs.influxdata.com/influxdb/v1.5/query_language/continuous_queries/#common-issues-with-basic-syntax scroll to issue-4

Upvotes: 18

Ammad
Ammad

Reputation: 4225

Into clause is now working with influxDB 0.12 and above.

SELECT * INTO ZZZD FROM P4978 

This will work

Upvotes: 2

beckettsean
beckettsean

Reputation: 1836

The INTO clause is intended for use with the downsampling continuous queries. Kapacitor is a better tool for copying data from one measurement to another.

Upvotes: -3

Related Questions