Docs

v2.0

duplicate() function

The duplicate() function duplicates a specified column in a table. If the specified column is part of the group key, it will be duplicated, but will not be part of the output table’s group key.

Function type: Transformation
Output data type: Object

duplicate(column: "column-name", as: "duplicate-name")

Parameters

column

The column to duplicate.

Data type: String

as

The name assigned to the duplicate column.

Data type: String

Examples

from(bucket: "telegraf/autogen")
	|> range(start:-5m)
	|> filter(fn: (r) => r._measurement == "cpu")
	|> duplicate(column: "host", as: "server")

Bug Reports and Feedback

Thank you for being willing to help test InfluxDB v2.0 alpha! Feedback and bug reports are welcome and encouraged both for InfluxDB and this documentation.

Submit feedback in the InfluxData Community