@@ -150,6 +150,29 @@ TEST_F(PartitionedGroupByTest, ReorderedKeys) {
150
150
compare_res_data (res2, id4_vals, id2_vals, id1_vals, id3_vals, v1_sums, v2_sums);
151
151
}
152
152
153
+ TEST_F (PartitionedGroupByTest, AggregationWithSort) {
154
+ auto old_exec = config ().exec ;
155
+ ScopeGuard g ([&old_exec]() { config ().exec = old_exec; });
156
+
157
+ config ().exec .group_by .default_max_groups_buffer_entry_guess = 1 ;
158
+ config ().exec .group_by .big_group_threshold = 1 ;
159
+ config ().exec .group_by .enable_cpu_partitioned_groupby = true ;
160
+ config ().exec .group_by .partitioning_buffer_size_threshold = 10 ;
161
+ config ().exec .group_by .partitioning_group_size_threshold = 1.5 ;
162
+ config ().exec .group_by .min_partitions = 2 ;
163
+ config ().exec .group_by .max_partitions = 8 ;
164
+ config ().exec .group_by .partitioning_buffer_target_size = 612 ;
165
+ config ().exec .enable_multifrag_execution_result = true ;
166
+
167
+ QueryBuilder builder (ctx (), getSchemaProvider (), configPtr ());
168
+ auto scan = builder.scan (" test1" );
169
+ auto dag1 = scan.agg ({" id1" s, " id2" s, " id3" s, " id4" s}, {" sum(v1)" s, " sum(v2)" s})
170
+ .sort ({0 , 1 , 2 , 3 })
171
+ .finalize ();
172
+ auto res = runQuery (std::move (dag1));
173
+ compare_res_data (res, id1_vals, id2_vals, id3_vals, id4_vals, v1_sums, v2_sums);
174
+ }
175
+
153
176
int main (int argc, char * argv[]) {
154
177
TestHelpers::init_logger_stderr_only (argc, argv);
155
178
testing::InitGoogleTest (&argc, argv);
0 commit comments