I’d like to create a continuous query that makes a straight copy of datapoints from one retention policy to another retention policy. The examples I’ve googled have used a SELECT mean(“value”) as well as a “group by time” as part of the the CQ. I don’t want that because the data I’m copying comes in sporadically, and I don’t want to average things.
Is something like this the correct way of doing it?
CREATE CONTINUOUS QUERY “status_cq” ON “main_database”
BEGIN
SELECT “value” AS value
INTO “infinite”.“status”
FROM “autogen”.“status”
group by topic
FILL(previous)
END
Afaik that’s not even possible, as CQs requires a group by time(), which will define the time interval/window considered by the query and also his frequency. (unless overridden with FOR and EVERY).
But requiring a group by time() also means that aggregation functions are mandatory, so you can’t just SELECT a field as a single point.
In the end, I don’t think what you ask is possible. CQs are meant for data downsampling not simple data transfer.
Note that manually doing SELECT ... INTO newRP FROM oldRP will work, but you can’t schedule that with as a CQ.
Possible workarounds (if you use Telegraf to input data or as a gateway)