2.4 KiB
2.4 KiB
title | description | menu | weight | flux/v0.x/tags | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
table.fill() function | The `table.fill()` function adds a single row to empty tables in a stream of tables. Columns in the group key are filled with the column value defined in the group key. Columns not in the group key are filled with a null value. |
|
401 |
|
The table.fill()
function adds a single row to empty tables in a stream of tables.
Columns that are in the group key are filled with the column value defined in the group key.
Columns not in the group key are filled with a null value.
import "experimental/table"
table.fill()
Parameters
tables
Input data.
Default is piped-forward data (<-
).
Examples
Query
import "experimental/table"
data
|> table.fill()
{{< flex >}} {{% flex-content %}}
Input data
Group key = [host: "host1", _field: "f1"]
host | _field | time | _value |
---|---|---|---|
host1 | f1 | 0001 | 2.8 |
host1 | f1 | 0002 | 3.2 |
host1 | f1 | 0003 | 3.3 |
Group key = [host: "host2", _field: "f1"]
host | _field | time | _value |
---|
Group key = [host: "host3", _field: "f1"]
host | _field | time | _value |
---|---|---|---|
host3 | f1 | 0001 | 1.4 |
host3 | f1 | 0002 | 1.5 |
host3 | f1 | 0003 | 2.7 |
{{% /flex-content %}} | |||
{{% flex-content %}} |
Output data
Group key = [host: "host1", _field: "f1"]
host | _field | time | _value |
---|---|---|---|
host1 | f1 | 0001 | 2.8 |
host1 | f1 | 0002 | 3.2 |
host1 | f1 | 0003 | 3.3 |
Group key = [host: "host2", _field: "f1"]
host | _field | time | _value |
---|---|---|---|
host2 | f1 |
Group key = [host: "host3", _field: "f1"]
host | _field | time | _value |
---|---|---|---|
host3 | f1 | 0001 | 1.4 |
host3 | f1 | 0002 | 1.5 |
host3 | f1 | 0003 | 2.7 |
{{% /flex-content %}} | |||
{{< /flex >}} |