Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(storage/flux): support table.fill() within aggregate window pushdown #21519

Merged
merged 1 commit into from
May 20, 2021

Conversation

jsternberg
Copy link
Contributor

This supports the table.fill() function within an
aggregate window.

import "experimental/table"

from(...)
|> range(...)
|> window(every: 5m, createEmpty: true)
|> max()
|> table.fill()
|> duplicate(column: "_stop", as: "_time")
|> window(every: inf)

This will now trigger the aggregate window pushdown and it will ensure
that there is a null row for windows where there are no points. In
contrast, the previous behavior was that selectors that used aggregate
window would have created windows stripped and therefore never
created.

This can be used by adding it to a call to aggregateWindow like so:

|> aggregateWindow(every: 5m, fn: (tables=<-, column) => tables |> max() |> table.fill())

At some point, we will add table.fill() to the aggregateWindow()
in the standard library. When this is done, the above example will
become unnecessary but it will also still do the same thing because
multiple table.fill() calls will be merged into each other.

@jsternberg jsternberg requested a review from rockstar May 19, 2021 20:35
…down

This supports the `table.fill()` function within an
aggregate window.

    import "experimental/table"

    from(...)
    |> range(...)
    |> window(every: 5m, createEmpty: true)
    |> max()
    |> table.fill()
    |> duplicate(column: "_stop", as: "_time")
    |> window(every: inf)

This will now trigger the aggregate window pushdown and it will ensure
that there is a null row for windows where there are no points.  In
contrast, the previous behavior was that selectors that used aggregate
window would have created windows stripped and therefore never
created.

This can be used by adding it to a call to `aggregateWindow` like so:

    |> aggregateWindow(every: 5m, fn: (tables=<-, column) => tables |> max() |> table.fill())

At some point, we will add `table.fill()` to the `aggregateWindow()`
in the standard library.  When this is done, the above example will
become unnecessary but it will also still do the same thing because
multiple `table.fill()` calls will be merged into each other.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants