jayzhan211 commented on issue #15676:
URL: https://github.com/apache/datafusion/issues/15676#issuecomment-2795627706

   ```rust
       fn should_update_state(
           &self,
           group_idx: usize,
           new_ordering_values: &[ScalarValue],
       ) -> Result<bool> {
           if !self.is_sets.get_bit(group_idx) {
               return Ok(true);
           }
   
           assert!(new_ordering_values.len() == self.ordering_req.len());
           let current_ordering = &self.orderings[group_idx];
           compare_rows(current_ordering, new_ordering_values, 
&self.sort_options).map(|x| {
               if self.pick_first_in_group {
                   x.is_gt()
               } else {
                   x.is_lt()
               }
           })
       }
   ```
   
   For last value, even the ordering is empty we still need to update the value.


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