alamb commented on code in PR #22319:
URL: https://github.com/apache/datafusion/pull/22319#discussion_r3312580102
##########
datafusion/optimizer/src/decorrelate.rs:
##########
@@ -512,18 +512,12 @@ fn agg_exprs_evaluation_result_on_empty_batch(
let result_expr = e
.clone()
.transform_up(|expr| {
- let new_expr = match expr {
- Expr::AggregateFunction(expr::AggregateFunction { func, ..
}) => {
- if func.name() == "count" {
- Transformed::yes(Expr::Literal(
- ScalarValue::Int64(Some(0)),
- None,
- ))
- } else {
- Transformed::yes(Expr::Literal(ScalarValue::Null,
None))
- }
- }
- _ => Transformed::no(expr),
+ let new_expr = if let Expr::AggregateFunction(agg) = &expr {
+ let return_type = expr.get_type(schema.as_ref())?;
Review Comment:
this is a nice cleanup
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]