--- title: table.fill() function description: > 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. menu: flux_0_x_ref: name: table.fill parent: table-exp weight: 401 flux/v0.x/tags: [transformations, fill] --- 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. ```js import "experimental/table" table.fill() ``` ## Parameters ### tables {data-type="stream of tables"} Input data. Default is piped-forward data ([`<-`](/flux/v0.x/spec/expressions/#pipe-expressions)). ## Examples ##### Query ```js 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 >}}