fred1268 commented on code in PR #23716:
URL: https://github.com/apache/datafusion/pull/23716#discussion_r3657996710
##########
datafusion/functions-aggregate/src/array_agg.rs:
##########
@@ -890,37 +981,38 @@ impl Accumulator for DistinctArrayAggAccumulator {
}
fn evaluate(&mut self) -> Result<ScalarValue> {
- let mut values: Vec<ScalarValue> =
self.values.keys().cloned().collect();
- if values.is_empty() {
+ if self.map.is_empty() {
return Ok(ScalarValue::new_null_list(self.datatype.clone(), true,
1));
}
- if let Some(opts) = self.sort_options {
- let mut delayed_cmp_err = Ok(());
- values.sort_by(|a, b| {
- if a.is_null() {
- return match opts.nulls_first {
- true => Ordering::Less,
- false => Ordering::Greater,
- };
- }
- if b.is_null() {
- return match opts.nulls_first {
- true => Ordering::Greater,
- false => Ordering::Less,
- };
- }
- match opts.descending {
- true => b.try_cmp(a),
- false => a.try_cmp(b),
- }
- .unwrap_or_else(|err| {
- delayed_cmp_err = Err(err);
- Ordering::Equal
- })
- });
- delayed_cmp_err?;
- };
+ let group_values = self
Review Comment:
I implemented something that is my understanding of your comment.
Please let me know if it is not the case.
--
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]