@@ -553,21 +553,22 @@ where
553553{
554554 fn update_batch (
555555 & mut self ,
556- values_with_orderings : & [ ArrayRef ] ,
556+ // e.g. first_value(a order by b): values_and_order_cols will be [a, b]
557+ values_and_order_cols : & [ ArrayRef ] ,
557558 group_indices : & [ usize ] ,
558559 opt_filter : Option < & BooleanArray > ,
559560 total_num_groups : usize ,
560561 ) -> Result < ( ) > {
561562 self . resize_states ( total_num_groups) ;
562563
563- let vals = values_with_orderings [ 0 ] . as_primitive :: < T > ( ) ;
564+ let vals = values_and_order_cols [ 0 ] . as_primitive :: < T > ( ) ;
564565
565566 let mut ordering_buf = Vec :: with_capacity ( self . ordering_req . len ( ) ) ;
566567
567568 // The overhead of calling `extract_row_at_idx_to_buf` is somewhat high, so we need to minimize its calls as much as possible.
568569 for ( group_idx, idx) in self
569570 . get_filtered_min_of_each_group (
570- & values_with_orderings [ 1 ..] ,
571+ & values_and_order_cols [ 1 ..] ,
571572 group_indices,
572573 opt_filter,
573574 vals,
@@ -576,7 +577,7 @@ where
576577 . into_iter ( )
577578 {
578579 extract_row_at_idx_to_buf (
579- & values_with_orderings [ 1 ..] ,
580+ & values_and_order_cols [ 1 ..] ,
580581 idx,
581582 & mut ordering_buf,
582583 ) ?;
@@ -643,7 +644,7 @@ where
643644
644645 let mut ordering_buf = Vec :: with_capacity ( self . ordering_req . len ( ) ) ;
645646
646- let ( is_set_arr, val_and_orderings ) = match values. split_last ( ) {
647+ let ( is_set_arr, val_and_order_cols ) = match values. split_last ( ) {
647648 Some ( result) => result,
648649 None => return internal_err ! ( "Empty row in FISRT_VALUE" ) ,
649650 } ;
@@ -653,15 +654,15 @@ where
653654 let vals = values[ 0 ] . as_primitive :: < T > ( ) ;
654655 // The overhead of calling `extract_row_at_idx_to_buf` is somewhat high, so we need to minimize its calls as much as possible.
655656 let groups = self . get_filtered_min_of_each_group (
656- & val_and_orderings [ 1 ..] ,
657+ & val_and_order_cols [ 1 ..] ,
657658 group_indices,
658659 opt_filter,
659660 vals,
660661 Some ( is_set_arr) ,
661662 ) ?;
662663
663664 for ( group_idx, idx) in groups. into_iter ( ) {
664- extract_row_at_idx_to_buf ( & val_and_orderings [ 1 ..] , idx, & mut ordering_buf) ?;
665+ extract_row_at_idx_to_buf ( & val_and_order_cols [ 1 ..] , idx, & mut ordering_buf) ?;
665666
666667 if self . should_update_state ( group_idx, & ordering_buf) ? {
667668 self . update_state (
0 commit comments