Fix order of aggregateWindow

Signed-off-by: davidarendsen <davidarendsen@hey.com>
This commit is contained in:
davidarendsen 2022-09-01 10:00:49 +00:00
commit e6a004e00c
2 changed files with 2 additions and 2 deletions

View file

@ -34,7 +34,6 @@ class QueryBuilder
self::FLUX_PART_FROM, self::FLUX_PART_FROM,
self::FLUX_PART_RANGE, self::FLUX_PART_RANGE,
self::FLUX_PART_REDUCE, self::FLUX_PART_REDUCE,
self::FLUX_PART_AGGREGATEWINDOW,
self::FLUX_PART_WINDOW, self::FLUX_PART_WINDOW,
self::FLUX_PART_FILTERS, self::FLUX_PART_FILTERS,
self::FLUX_PART_MAP, self::FLUX_PART_MAP,
@ -42,6 +41,7 @@ class QueryBuilder
self::FLUX_PART_GROUP, self::FLUX_PART_GROUP,
self::FLUX_PART_LIMIT, self::FLUX_PART_LIMIT,
self::FLUX_PART_UNWINDOW, self::FLUX_PART_UNWINDOW,
self::FLUX_PART_AGGREGATEWINDOW,
]; ];
public const REQUIRED_INPUT_FROM = 'from'; public const REQUIRED_INPUT_FROM = 'from';

View file

@ -146,7 +146,7 @@ final class QueryBuilderTest extends TestCase
$expectedQuery = 'from(bucket: "test_bucket") |> range(start: time(v: 2022-08-12T17:31:00Z)) ' . $expectedQuery = 'from(bucket: "test_bucket") |> range(start: time(v: 2022-08-12T17:31:00Z)) ' .
'|> reduce(fn: (r, accumulator) => ({count: accumulator.count + 1}), identity: {count: 0}) ' . '|> reduce(fn: (r, accumulator) => ({count: accumulator.count + 1}), identity: {count: 0}) ' .
'|> aggregateWindow(every: 20s, fn: mean) |> filter(fn: (r) => r._measurement == "test_measurement") '; '|> filter(fn: (r) => r._measurement == "test_measurement") |> aggregateWindow(every: 20s, fn: mean) ';
$this->assertEquals($expectedQuery, $queryBuilder->build()); $this->assertEquals($expectedQuery, $queryBuilder->build());
} }