Documentation

experimental.unique() function

experimental.unique() is subject to change at any time. By using this function, you accept the risks of experimental functions.

experimental.unique() returns all records containing unique values in the _value column.

null is considered a unique value.

Function behavior

  • Outputs a single table for each input table.
  • Outputs a single record for each unique value in an input table.
  • Leaves group keys, columns, and values unmodified.
  • Drops emtpy tables.
Function type signature
(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}]
For more information, see Function type signatures.

Parameters

tables

Input data. Default is piped-forward data (<-).

Examples

Return rows with unique values in each input table

import "experimental"
import "sampledata"

sampledata.int(includeNull: true)
    |> experimental.unique()

View example input and ouput


Was this page helpful?

Thank you for your feedback!


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.