Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -67,6 +67,6 @@ public LogicalPlan apply(LogicalPaginate plan, Captures captures) {
var scan = logicalRelation.getTable().createPagedScanBuilder(plan.getPageSize());
relationParent.replaceChildPlans(List.of(scan));

return plan;
return plan.getChild().get(0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,13 @@ public PhysicalPlan implement(LogicalPlan plan) {
() -> table.createWriteBuilder(null));
}

@Test
@Test
void paged_table_scan_builder_support_project_push_down_can_apply_its_rule() {

var relation = relation("schema", table);

assertEquals(
paginate(project(pagedTableScanBuilder), 4),
project(pagedTableScanBuilder),
LogicalPlanOptimizer.create().optimize(paginate(project(relation), 4)));
}

Expand Down Expand Up @@ -391,7 +391,6 @@ void push_page_size_noop_if_no_sub_plans() {
assertEquals(paginate,
LogicalPlanOptimizer.create().optimize(paginate));
}

@Test
void table_scan_builder_support_offset_push_down_can_apply_its_rule() {
when(table.createPagedScanBuilder(anyInt())).thenReturn(pagedTableScanBuilder);
Expand All @@ -401,7 +400,7 @@ void table_scan_builder_support_offset_push_down_can_apply_its_rule() {
.optimize(new LogicalPaginate(42, List.of(project(relation))));
// `optimized` structure: LogicalPaginate -> LogicalProject -> TableScanBuilder
// LogicalRelation replaced by a TableScanBuilder instance
assertEquals(paginate(project(pagedTableScanBuilder), 42), optimized);
assertEquals(project(pagedTableScanBuilder), optimized);
}

private LogicalPlan optimize(LogicalPlan plan) {
Expand Down