How can one merge two arrays?

How can one join/merge two arrays?

Here is an example:

good = ["foo", "bar"]

from(bucket: "xxx")
  ...
  |> keep(columns: ["_time", "_value"] + good)

Hello @LionelCons,
Unfortunately this isn’t possible atm. Why are you wondering? What are you trying to do? Maybe there’s another workaround.
Alternatively, can you please file a feature request?

Thank you

The goal was to remove duplication in the code. I have a bunch of columns that I use in different places (group, pivot, keep…) and I wanted to define them in one place only.

Also, the code should evolve into periodic tasks, hopefully via named functions so the array of columns will likely be one parameter of the function.

I’ll file a feature request in GitHub.

FWIW, I’ve submitted https://github.com/influxdata/flux/issues/3397.

1 Like