Skip to content

Commit

Permalink
Fix aggregates reordering domain size
Browse files Browse the repository at this point in the history
  • Loading branch information
rlwww committed Nov 9, 2023
1 parent fe77c23 commit e72588e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nemo/src/execution/planning/aggregates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ pub(super) fn generate_node_aggregate(
.map(|variable| *variable_order.get(variable).unwrap())
.collect();

let reordering = ProjectReordering::from_vector(reordering_column_indices, 3);
let reordering =
ProjectReordering::from_vector(reordering_column_indices, variable_order.len());

node = current_plan.plan_mut().project(node, reordering);

Expand Down
2 changes: 2 additions & 0 deletions resources/testcases/aggregate_basic/distinct.rls
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@source sourceA[integer,integer,integer]: load-csv("sources/dataA.csv").
@source sourceB[integer,integer,integer,integer]: load-csv("sources/dataB.csv").

r0(#count(?X, ?Y)) :- sourceA(?X, ?Y, ?Z).
r1(#count(?X, ?Y, ?Z)) :- sourceA(?X, ?Y, ?Z).
r2(?X, #count(?Y, ?Z)) :- sourceA(?X, ?Y, ?Z).
r3(?X1, #sum(?X2, ?X4)) :- sourceB(?X1, ?X2, ?X3, ?X4).
2 changes: 2 additions & 0 deletions resources/testcases/aggregate_basic/distinct/r3.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1,8
2,1
7 changes: 7 additions & 0 deletions resources/testcases/aggregate_basic/sources/dataB.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
1,1,1,1
1,2,3,4
1,2,4,4
1,2,5,4
1,2,6,3
1,3,4,4
2,1,1,1

0 comments on commit e72588e

Please sign in to comment.