Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy from a measurement to another measurement in InfluxDB

Tags:

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.

like image 450
sarbo Avatar asked Mar 03 '16 12:03

sarbo


People also ask

How do I retrieve data from InfluxDB?

To perform a query send a GET request to the /query endpoint, set the URL parameter db as the target database, and set the URL parameter q as your query. You may also use a POST request by sending the same parameters either as URL parameters or as part of the body with application/x-www-form-urlencoded .

How do I view Dimensions in InfluxDB?

influxdb Querying Influx Show measurementsIn-depth information about this can be found in the API docs 'Show Measurements'.

How do I change the measurement name in InfluxDB?

There is no RENAME operation but you can copy a measurement into another, then delete it.

What is precision in InfluxDB?

The precision of the timestamp can be controlled to return hours (h), minutes (m), seconds (s), milliseconds (ms), microseconds (u) or nanoseconds (ns). A special precision option is RFC3339 which returns the timestamp in RFC3339 format with nanosecond precision.


2 Answers

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

like image 123
Rodrigo Estebanez Avatar answered Oct 22 '22 07:10

Rodrigo Estebanez


Into clause is now working with influxDB 0.12 and above.

SELECT * INTO ZZZD FROM P4978 

This will work

like image 32
Ammad Avatar answered Oct 22 '22 05:10

Ammad