Open vially opened 4 years ago
@vially do you have any updates on this? I might be experiencing a similar issue where not all values are selected into a new measurement via the Go client. If I run the same query via the influx
tool, all values get copied.
@vially do you have any updates on this? I might be experiencing a similar issue where not all values are selected into a new measurement via the Go client. If I run the same query via the
influx
tool, all values get copied.
I think I found the answer to my problem in the faq.
I think I'm facing the same issue with influxd 1.8.3.
use "source-db"
show measurements
select * into "destination-db"..:MEASUREMENT from /.*/ GROUP BY *
use "destination-db"
show measurements
The measurement list in the destination database is incomplete and from a quick comparison, only the measurements with numerical values are copied.
I'm afraid this is a serious issue as AFAIK
use src_db
SELECT * INTO dest_db..:MEASUREMENT FROM /.*/ GROUP BY *
is the recommended way to copy all data from one database to another (here for instance).
@vially I've been investigating and I think this is the consequence of an issue with FROM regex
.
See #20365.
@lafrech It does look like that could be the root cause for this issue. Great find!
Steps to reproduce:
The commands below were run in the
influx
shell connected to a new InfluxDB server instance.These commands are supposed to duplicate a database containing two measurements (with two data points each):
temperature
measurement with asensor
tag and avalue
field of typefloat
state
measurement with asensor
tag and avalue
field of typestring
It looks like the
SELECT * INTO
command only copied thetemperature
measurement to the new database. Thestate
measurement was not copied over.For some reason it looks like this might have something to do with the
value
field of thestate
measurement being of typestring
. I noticed a similar behavior withboolean
fields too.I'm not sure if this is a bug or a known issue, but I wasn't able to find anything related to this behavior in the documentation.
Expected behavior:
I was expecting both the
temperature
and thestate
measurements to be copied over to theplayground_copy
database.Actual behavior:
Only the
temperature
measurement was actually copied. Thestate
measurement was missing from theplayground_copy
database.Environment info:
Linux 5.6.13-arch1-1 x86_64
InfluxDB shell version: 1.8.0
Config:
The config was not modified in any way. The server was running using the default config that comes with the
1.8.0
docker image.