mustafasrepo commented on code in PR #9411:
URL: https://github.com/apache/arrow-datafusion/pull/9411#discussion_r1508526957


##########
datafusion/physical-expr/src/aggregate/first_last.rs:
##########
@@ -259,8 +295,20 @@ impl FirstValueAccumulator {
                 options: Some(req.options),
             })
             .collect::<Vec<_>>();
-        let indices = lexsort_to_indices(&sort_columns, Some(1))?;
-        Ok((!indices.is_empty()).then_some(indices.value(0) as _))
+
+        if self.is_ignore_null {
+            let indices = lexsort_to_indices(&sort_columns, 
Some(value.len()))?;

Review Comment:
   instead you can use 
   ```suggestion
               let indices = lexsort_to_indices(&sort_columns, None)?;
   ```
   to be more explicit about we are sorting whole array



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

Reply via email to