drop() function

The drop() function removes specified columns from a table. Columns are specified either through a list or a predicate function. When a dropped column is part of the group key, it will be removed from the key. If a specified column is not present in a table, it will return an error.

Function type: Transformation
Output data type: Object

drop(columns: ["col1", "col2"])

// OR

drop(fn: (column) => column =~ /usage*/)



Columns to be removed from the table. Cannot be used with fn.

Data type: Array of strings


A predicate function which takes a column name as a parameter (column) and returns a boolean indicating whether or not the column should be removed from the table. Cannot be used with columns.

Data type: Function


Drop a list of columns
from(bucket: "telegraf/autogen")
	|> range(start: -5m)
	|> drop(columns: ["host", "_measurement"])
Drop columns matching a predicate
from(bucket: "telegraf/autogen")
  |> range(start: -5m)
  |> drop(fn: (column) => column =~ /usage*/)


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