use of com.facebook.presto.sql.tree.Window in project presto by prestodb.
the class TestSwapAdjacentWindowsBySpecifications method dependentWindowsAreNotReordered.
@Test
public void dependentWindowsAreNotReordered() {
Optional<Window> windowA = Optional.of(new Window(ImmutableList.of(new SymbolReference("a")), Optional.empty(), Optional.empty()));
tester().assertThat(new GatherAndMergeWindows.SwapAdjacentWindowsBySpecifications(0)).on(p -> p.window(new WindowNode.Specification(ImmutableList.of(p.variable("a")), Optional.empty()), ImmutableMap.of(p.variable("avg_1"), newWindowNodeFunction(ImmutableList.of(new Symbol("avg_2")))), p.window(new WindowNode.Specification(ImmutableList.of(p.variable("a"), p.variable("b")), Optional.empty()), ImmutableMap.of(p.variable("avg_2"), newWindowNodeFunction(ImmutableList.of(new Symbol("a")))), p.values(p.variable("a"), p.variable("b"))))).doesNotFire();
}
Aggregations