@@ -49,6 +49,7 @@ use std::sync::Arc;
49
49
mod bounded_aggregate_stream;
50
50
mod no_grouping;
51
51
mod row_hash;
52
+ mod row_hash2;
52
53
mod utils;
53
54
54
55
pub use datafusion_expr:: AggregateFunction ;
@@ -58,6 +59,8 @@ use datafusion_physical_expr::utils::{
58
59
get_finer_ordering, ordering_satisfy_requirement_concrete,
59
60
} ;
60
61
62
+ use self :: row_hash2:: GroupedHashAggregateStream2 ;
63
+
61
64
/// Hash aggregate modes
62
65
#[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
63
66
pub enum AggregateMode {
@@ -196,6 +199,7 @@ impl PartialEq for PhysicalGroupBy {
196
199
enum StreamType {
197
200
AggregateStream ( AggregateStream ) ,
198
201
GroupedHashAggregateStream ( GroupedHashAggregateStream ) ,
202
+ GroupedHashAggregateStream2 ( GroupedHashAggregateStream2 ) ,
199
203
BoundedAggregate ( BoundedAggregateStream ) ,
200
204
}
201
205
@@ -204,6 +208,7 @@ impl From<StreamType> for SendableRecordBatchStream {
204
208
match stream {
205
209
StreamType :: AggregateStream ( stream) => Box :: pin ( stream) ,
206
210
StreamType :: GroupedHashAggregateStream ( stream) => Box :: pin ( stream) ,
211
+ StreamType :: GroupedHashAggregateStream2 ( stream) => Box :: pin ( stream) ,
207
212
StreamType :: BoundedAggregate ( stream) => Box :: pin ( stream) ,
208
213
}
209
214
}
@@ -711,12 +716,23 @@ impl AggregateExec {
711
716
partition,
712
717
aggregation_ordering,
713
718
) ?) )
719
+ } else if self . use_poc_group_by ( ) {
720
+ Ok ( StreamType :: GroupedHashAggregateStream2 (
721
+ GroupedHashAggregateStream2 :: new ( self , context, partition) ?,
722
+ ) )
714
723
} else {
715
724
Ok ( StreamType :: GroupedHashAggregateStream (
716
725
GroupedHashAggregateStream :: new ( self , context, partition) ?,
717
726
) )
718
727
}
719
728
}
729
+
730
+ /// Returns true if we should use the POC group by stream
731
+ /// TODO: check for actually supported aggregates, etc
732
+ fn use_poc_group_by ( & self ) -> bool {
733
+ //info!("AAL Checking POC group by: {self:#?}");
734
+ true
735
+ }
720
736
}
721
737
722
738
impl ExecutionPlan for AggregateExec {
@@ -980,7 +996,7 @@ fn group_schema(schema: &Schema, group_count: usize) -> SchemaRef {
980
996
Arc :: new ( Schema :: new ( group_fields) )
981
997
}
982
998
983
- /// returns physical expressions to evaluate against a batch
999
+ /// returns physical expressions for arguments to evaluate against a batch
984
1000
/// The expressions are different depending on `mode`:
985
1001
/// * Partial: AggregateExpr::expressions
986
1002
/// * Final: columns of `AggregateExpr::state_fields()`
0 commit comments