GaneshPatil7517 commented on code in PR #19868:
URL: https://github.com/apache/datafusion/pull/19868#discussion_r2701274726


##########
datafusion/functions-aggregate/src/array_agg.rs:
##########
@@ -484,6 +524,11 @@ impl Accumulator for DistinctArrayAggAccumulator {
     fn evaluate(&mut self) -> Result<ScalarValue> {
         let mut values: Vec<ScalarValue> = 
self.values.iter().cloned().collect();
         if values.is_empty() {
+            // Return empty array instead of NULL when result is non-nullable
+            if !self.nullable_result {
+                let arr = ScalarValue::new_list(&[], &self.datatype, true);
+                return Ok(ScalarValue::List(arr));
+            }

Review Comment:
   ok ill work on it...



-- 
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]

Reply via email to