I have two queries that I combine using the union() function in InfluxDB.
core_data = from(bucket: "tel-cats")
|> range(start: v.timeRangeStart, stop:v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "core")
|> keep(columns: ["_time", "_value", "cats_id"])
|> group()
kdump_data = from(bucket: "tel-cats")
|> range(start: v.timeRangeStart, stop:v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "kdump")
|> keep(columns: ["_time", "_value", "cats_id"])
|> group()
union(tables: [core_data, kdump_data])
The union output looks like this:
The resulting table has a cats_id
column. For each cats_id
value, I want to perform an additional query to retrieve a single value (let’s call it “X”) from another bucket and add it as a new column in the existing table.
So eventually, I would have a new column with a value for each cats_id
.
I do not want the new column to be written into the DB.