schema.fieldsAsCols() function
The schema.fieldsAsCols()
function is a special application of the
pivot()
function that pivots on _field
and _time
columns to aligns fields within each
input table that have the same timestamp.
import "influxdata/influxdb/schema"
schema.fieldsAsCols()
Parameters
tables
Input data.
Default is piped-forward data (<-
).
Examples
import "influxdata/influxdb/schema"
from(bucket:"example-bucket")
|> range(start: -1h)
|> filter(fn: (r) => r._measurement == "cpu")
|> schema.fieldsAsCols()
Not supported in the Flux REPL
schema
functions can retrieve schema information when executed within
the context of InfluxDB, but not from the Flux REPL.
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, the following resources are available:
InfluxDB Cloud customers can contact InfluxData Support.