Troubles with basics of Flux

I’m new to InfluxDB as well as to Flux, so maybe this is a reason. But I’m trying some snippets from documentation 1-1 and getting errors. For example:

getColumn() function.

Example 1:

import "sampledata"

sampledata.int()
    |> tableFind(fn: (key) => key.tag == "t1")
    |> getColumn(column: "_value")

Example 2:

import "array"
import "sampledata"

columnData =
    sampledata.int()
        |> tableFind(fn: (key) => key.tag == "t1")
        |> getColumn(column: "_value")

array.from(rows: [{_value: display(v: columnData)}])

error:

 error calling function "getColumn" @18:6-18:30: unexpected type for table: want {schema: [{grouped: bool, label: string, type: string}]}, got [t1011]

What am I doing wrong?

PS: I’m using InfluxDB 2.0

Hello @khataev,
I’d try upgrading. I don’t get any error when I use 2.7:

@Anaisdg thank you, I was using 2.0, upgrade to 2.7 helped!

1 Like