jonahgao commented on code in PR #14824:
URL: https://github.com/apache/datafusion/pull/14824#discussion_r1967845194


##########
datafusion/physical-plan/src/aggregates/mod.rs:
##########
@@ -1231,6 +1233,13 @@ fn evaluate(
     expr: &[Arc<dyn PhysicalExpr>],
     batch: &RecordBatch,
 ) -> Result<Vec<ArrayRef>> {
+    // handle count() case
+    if expr.is_empty() {
+        return Ok(vec![
+            Arc::new(Int64Array::from(vec![1; batch.num_rows()])) as ArrayRef

Review Comment:
   It seems that this function is not only used by `count`. I'm not quite sure 
about the impact of this change.
   Ideally, this function should not involve the logic of any specific 
aggregation function.



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to