What would be equivalent flux query for SELECT address, name FROM addresses
? (I am referring to FluxQL, the new query language developed by InfluxData)
I didn't find a clear answer to this in the limited Flux Documentation present. Flux documentation says that filter()
function is the equivalent of both SELECT
and WHERE
clauses, but all examples given are equivalent of WHERE
clauses, nothing on SELECT
.
These are the documentation for FluxQL for better reference:
https://docs.influxdata.com/flux/v0.50/introduction/getting-started
https://v2.docs.influxdata.com/v2.0/query-data/get-started/
Flux is a standalone data scripting and query language that increases productivity and code reuse. Flux is optimized for ETL, monitoring, and alerting, with an inline planner and optimizer. Flux is the result of the open source community driving innovation with time series data.
InfluxDB lets you specify fields and tags, both being key/value pairs where the difference is that tags are automatically indexed. Because fields are not being indexed at all, on every query where InfluxDB is asked to find a specified field, it needs to sequentially scan every value of the field column.
Flux is InfluxData's functional data scripting language designed for querying, analyzing, and acting on data.
maybe you need something like this:
filter(fn: (r) => r._measurement == "addresses" and (r._field == "address" or r._field == "name"))
|> pivot(rowKey:["_time"], columnKey:["_field"], valueColumn:"_value")
|> drop(columns:["_value", ...])
in the "drop" (instead of ...) you can list all excesses columns
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With