1.1 KiB
1.1 KiB
title | description | menu | weight | v2.0/tags | related | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
geo.toRows() function | The geo.toRows() function ... |
|
401 |
|
|
The geo.toRows()
function pivots data into row-wise sets base on time or other correlation columns.
For geo-temporal datasets, output rows include lat
and lon
columns required by
many Geo package functions.
Function type: Transformation
import "experimental/geo"
geo.toRows(
correlationKey: ["_time"]
)
Parameters
correlationKey
List of columns used to uniquely identify a row for output.
Default is ["_time"]
.
Data type: Array of strings
Examples
import "experimental/geo"
from(bucket: "example-bucket")
|> range(start: -1h)
|> filter(fn: (r) => r._measurement == "example-measurement")
|> geo.toRows()
Function definition
toRows = (tables=<-, correlationKey=["_time"]) =>
tables
|> pivot(
rowKey: correlationKey,
columnKey: ["_field"],
valueColumn: "_value"
)