Skip to content

Commit

Permalink
Fix conflict from rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Sep 19, 2019
1 parent 29f1197 commit 6004d08
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
3 changes: 2 additions & 1 deletion rust/datafusion/src/execution/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ use crate::execution::filter::FilterRelation;
use crate::execution::limit::LimitRelation;
use crate::execution::physical_plan::common;
use crate::execution::physical_plan::datasource::DatasourceExec;
use crate::execution::physical_plan::expressions::Column;
use crate::execution::physical_plan::expressions::{Column, Sum};
use crate::execution::physical_plan::hash_aggregate::HashAggregateExec;
use crate::execution::physical_plan::merge::MergeExec;
use crate::execution::physical_plan::projection::ProjectionExec;
use crate::execution::physical_plan::{AggregateExpr, ExecutionPlan, PhysicalExpr};
Expand Down
21 changes: 14 additions & 7 deletions rust/datafusion/src/execution/physical_plan/hash_aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,20 @@ impl ExecutionPlan for HashAggregateExec {
let schema = Arc::new(Schema::new(fields));

let merge = MergeExec::new(schema.clone(), partitions);

Ok(vec![Arc::new(HashAggregatePartition::new(
final_group,
final_aggr,
Arc::new(merge),
schema,
))])
let merged: Vec<Arc<dyn Partition>> = merge.partitions()?;
if merged.len() == 1 {
Ok(vec![Arc::new(HashAggregatePartition::new(
final_group,
final_aggr,
merged[0].clone(),
schema,
))])
} else {
Err(ExecutionError::InternalError(format!(
"MergeExec returned {} partitions",
merged.len()
)))
}
}
}

Expand Down
1 change: 1 addition & 0 deletions rust/datafusion/src/execution/physical_plan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@ pub mod common;
pub mod csv;
pub mod datasource;
pub mod expressions;
pub mod hash_aggregate;
pub mod merge;
pub mod projection;

0 comments on commit 6004d08

Please sign in to comment.