experimental.unique() function
The experimental.unique()
function is subject to change at any time.
By using this function, you accept the risks of experimental functions.
The experimental.unique()
function returns all records containing unique
values in the _value
column.
null
is considered a unique value.
experimental.unique()
is a selector function.
import "experimental"
experimental.unique()
Output schema
experimental.unique()
outputs a single table for each input table and does
the following:
- Outputs a single record for each unique value.
- Leaves group keys, columns, and values unmodified.
Empty tables
experimental.unique()
drops empty tables.
Parameters
tables
Input data.
Default is piped-forward data (<-
).
Examples
import "experimental"
data
|> experimental.unique()
Input data
_time | _field | _value |
---|---|---|
2021-01-01T00:00:00Z | ver | v1 |
2021-01-01T00:01:00Z | ver | v1 |
2021-01-01T00:02:00Z | ver | v2 |
2021-01-01T00:03:00Z | ver | |
2021-01-01T00:04:00Z | ver | v3 |
2021-01-01T00:05:00Z | ver | v3 |
Output data
_time | _field | _value |
---|---|---|
2021-01-01T00:00:00Z | ver | v1 |
2021-01-01T00:02:00Z | ver | v2 |
2021-01-01T00:03:00Z | ver | |
2021-01-01T00:04:00Z | ver | v3 |
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.