Skip to content

Commit

Permalink
Address PR feedback.
Browse files Browse the repository at this point in the history
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
  • Loading branch information
MaxKsyunz committed Apr 13, 2023
1 parent 31315dc commit 9df41c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,19 @@ public CreatePagingTableScanBuilder() {
*/
private boolean findLogicalRelation(LogicalPaginate logicalPaginate) {
Deque<LogicalPlan> plans = new ArrayDeque<>();
plans.push(logicalPaginate);
plans.add(logicalPaginate);
do {
var plan = plans.pop();
if (plan.getChild().stream().anyMatch(LogicalRelation.class::isInstance)) {
if (plan.getChild().size() > 1) {
throw new UnsupportedOperationException();
final var plan = plans.removeFirst();
final var children = plan.getChild();
if (children.stream().anyMatch(LogicalRelation.class::isInstance)) {
if (children.size() > 1) {
throw new UnsupportedOperationException(
"Unsupported plan: relation operator cannot have siblings");
}
relationParent = plan;
return true;
}
plan.getChild().forEach(plans::push);
plans.addAll(children);
} while (!plans.isEmpty());
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,6 @@ void pagination_optimizer_simple_query() {
optimizer.optimize(projectPlan);
verify(table).createScanBuilder();
verify(table, never()).createPagedScanBuilder(anyInt());
// Assert that createPagedTableScan was not called
// Assert that createTableScan was called
}
}

Expand Down

0 comments on commit 9df41c7

Please sign in to comment.