Skip to content

Apache DataFusion SQL Query Engine

Implement serde for MIN and MAX (#833)

Andy Groveea1356f6af2c
diff --git a/ballista/rust/core/src/serde/physical_plan/to_proto.rs b/ballista/rust/core/src/serde/physical_plan/to_proto.rs
index ec5ec7cb7a..48b2134552 100644
--- a/ballista/rust/core/src/serde/physical_plan/to_proto.rs
+++ b/ballista/rust/core/src/serde/physical_plan/to_proto.rs
@@ -47,7 +47,7 @@ use datafusion::{
use datafusion::physical_plan::{
empty::EmptyExec,
- expressions::{Avg, BinaryExpr, Column, Sum},
+ expressions::{Avg, BinaryExpr, Column, Max, Min, Sum},
Partitioning,
};
use datafusion::physical_plan::{AggregateExpr, ExecutionPlan, PhysicalExpr};
@@ -421,6 +421,10 @@ impl TryInto<protobuf::PhysicalExprNode> for Arc<dyn AggregateExpr> {
Ok(protobuf::AggregateFunction::Sum.into())
} else if self.as_any().downcast_ref::<Count>().is_some() {
Ok(protobuf::AggregateFunction::Count.into())
+ } else if self.as_any().downcast_ref::<Min>().is_some() {
+ Ok(protobuf::AggregateFunction::Min.into())
+ } else if self.as_any().downcast_ref::<Max>().is_some() {
+ Ok(protobuf::AggregateFunction::Max.into())
} else {
Err(BallistaError::NotImplemented(format!(
"Aggregate function not supported: {:?}",