Skip to content

Commit

Permalink
fix UT
Browse files Browse the repository at this point in the history
  • Loading branch information
lancelly committed Jan 22, 2025
1 parent fc10331 commit ff65b84
Showing 1 changed file with 69 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,89 +344,83 @@ public void testUncorrelatedAnyComparisonSubquery() {
* └──OutputNode
* └──ProjectNode
* └──FilterNode
* └──ProjectNode
* └──JoinNode
* |──TableScanNode
* ├──AggregationNode
* │ └──TableScanNode
* └──JoinNode
* |──TableScanNode
* ├──AggregationNode
* └──TableScanNode
*/
assertPlan(
logicalQueryPlan,
output(
project(
anyTree(
project(
join(
JoinNode.JoinType.INNER,
builder ->
builder
.left(tableScan1)
.right(
aggregation(
singleGroupingSet(),
ImmutableMap.of(
Optional.of("min"),
aggregationFunction(
"min", ImmutableList.of("s1_7")),
Optional.of("count_all"),
aggregationFunction(
"count_all", ImmutableList.of("s1_7")),
Optional.of("count_non_null"),
aggregationFunction(
"count", ImmutableList.of("s1_7"))),
Collections.emptyList(),
Optional.empty(),
SINGLE,
tableScan2))))))));
join(
JoinNode.JoinType.INNER,
builder ->
builder
.left(tableScan1)
.right(
aggregation(
singleGroupingSet(),
ImmutableMap.of(
Optional.of("min"),
aggregationFunction("min", ImmutableList.of("s1_7")),
Optional.of("count_all"),
aggregationFunction(
"count_all", ImmutableList.of("s1_7")),
Optional.of("count_non_null"),
aggregationFunction("count", ImmutableList.of("s1_7"))),
Collections.emptyList(),
Optional.empty(),
SINGLE,
tableScan2)))))));

// Verify DistributionPlan
assertPlan(
planTester.getFragmentPlan(0),
output(
project(
anyTree(
project(
join(
JoinNode.JoinType.INNER,
builder ->
builder
.left(collect(exchange(), tableScan1, exchange()))
.right(
aggregation(
singleGroupingSet(),
ImmutableMap.of(
Optional.of("min"),
aggregationFunction(
"min", ImmutableList.of("min_9")),
Optional.of("count_all"),
aggregationFunction(
"count_all", ImmutableList.of("count_all_10")),
Optional.of("count_non_null"),
aggregationFunction(
"count", ImmutableList.of("count"))),
Collections.emptyList(),
Optional.empty(),
FINAL,
collect(
exchange(),
aggregation(
singleGroupingSet(),
ImmutableMap.of(
Optional.of("min_9"),
aggregationFunction(
"min", ImmutableList.of("s1_6")),
Optional.of("count_all_10"),
aggregationFunction(
"count_all", ImmutableList.of("s1_6")),
Optional.of("count"),
aggregationFunction(
"count", ImmutableList.of("s1_6"))),
Collections.emptyList(),
Optional.empty(),
PARTIAL,
tableScan3),
exchange())))))))));
join(
JoinNode.JoinType.INNER,
builder ->
builder
.left(collect(exchange(), tableScan1, exchange()))
.right(
aggregation(
singleGroupingSet(),
ImmutableMap.of(
Optional.of("min"),
aggregationFunction("min", ImmutableList.of("min_9")),
Optional.of("count_all"),
aggregationFunction(
"count_all", ImmutableList.of("count_all_10")),
Optional.of("count_non_null"),
aggregationFunction(
"count", ImmutableList.of("count"))),
Collections.emptyList(),
Optional.empty(),
FINAL,
collect(
exchange(),
aggregation(
singleGroupingSet(),
ImmutableMap.of(
Optional.of("min_9"),
aggregationFunction(
"min", ImmutableList.of("s1_6")),
Optional.of("count_all_10"),
aggregationFunction(
"count_all", ImmutableList.of("s1_6")),
Optional.of("count"),
aggregationFunction(
"count", ImmutableList.of("s1_6"))),
Collections.emptyList(),
Optional.empty(),
PARTIAL,
tableScan3),
exchange()))))))));

assertPlan(planTester.getFragmentPlan(1), tableScan1);

Expand Down Expand Up @@ -519,19 +513,16 @@ public void testUncorrelatedAllComparisonSubquery() {
* └──OutputNode
* └──ProjectNode
* └──FilterNode
* └──ProjectNode
* └──SemiJoinNode
* |──SortNode
* | └──TableScanNode
* ├──SortNode
* │ └──TableScanNode
* └──SemiJoinNode
* |──SortNode
* | └──TableScanNode
* ├──SortNode
* │ └──TableScanNode
*/
assertPlan(
logicalQueryPlan,
output(
project(
anyTree(
project(semiJoin("s1", "s1_6", "expr", sort(tableScan1), sort(tableScan2)))))));
project(anyTree(semiJoin("s1", "s1_6", "expr", sort(tableScan1), sort(tableScan2))))));
}
}

0 comments on commit ff65b84

Please sign in to comment.