Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,34 @@ public void testCanStreamNoJoin()
assertThat(SchedulingUtils.canStream(parentSubPlan, valuesSubPlan("a"))).isTrue();
}

@Test
public void testCanStreamUnion()
{
/*
parent(union)
/ \ \
-------------------------------------- stage boundary
a b c
*/
SubPlan aSubPlan = valuesSubPlan("a");
RemoteSourceNode remoteSourceA = remoteSource("a");

SubPlan bSubPlan = valuesSubPlan("b");
RemoteSourceNode remoteSourceB = remoteSource("b");

SubPlan cSubPlan = valuesSubPlan("c");
RemoteSourceNode remoteSourceC = remoteSource("c");

SubPlan parentSubPlan = createSubPlan(
"parent",
union("union", ImmutableList.of(remoteSourceA, remoteSourceB, remoteSourceC)),
ImmutableList.of(aSubPlan, bSubPlan));
Comment on lines +93 to +96
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (testing): Check if all union children are included in parentSubPlan's children.

Please verify that cSubPlan is either intentionally excluded or properly accounted for; otherwise, the test may not represent the union's full structure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why cSubPlan isn't a child of "parent"?


assertThat(SchedulingUtils.canStream(parentSubPlan, aSubPlan)).isTrue();
assertThat(SchedulingUtils.canStream(parentSubPlan, bSubPlan)).isTrue();
assertThat(SchedulingUtils.canStream(parentSubPlan, cSubPlan)).isTrue();
}

@Test
public void testCanStreamJoin()
{
Expand Down