zhuqi-lucas commented on PR #15348:
URL: https://github.com/apache/datafusion/pull/15348#issuecomment-2746127139

   > Thank you @zhuqi-lucas -- this looks pretty sweet. I think we need to sort 
out nulls and safety comment and this will be good to go
   
   Thank you @alamb for review, good suggestion, and i checked the nullable 
check is checked in the parent wrapper call, for example:
   ```rust
   impl<T: CursorValues> CursorValues for ArrayValues<T> {
       fn len(&self) -> usize {
           self.values.len()
       }
   
       fn eq(l: &Self, l_idx: usize, r: &Self, r_idx: usize) -> bool {
           match (l.is_null(l_idx), r.is_null(r_idx)) {
               (true, true) => true,
               (false, false) => T::eq(&l.values, l_idx, &r.values, r_idx),
               _ => false,
           }
       }
   
       fn eq_to_previous(cursor: &Self, idx: usize) -> bool {
           assert!(idx > 0);
           match (cursor.is_null(idx), cursor.is_null(idx - 1)) {
               (true, true) => true,
               (false, false) => T::eq(&cursor.values, idx, &cursor.values, idx 
- 1),
               _ => false,
           }
       }
   
       fn compare(l: &Self, l_idx: usize, r: &Self, r_idx: usize) -> Ordering {
           match (l.is_null(l_idx), r.is_null(r_idx)) {
               (true, true) => Ordering::Equal,
               (true, false) => match l.options.nulls_first {
                   true => Ordering::Less,
                   false => Ordering::Greater,
               },
               (false, true) => match l.options.nulls_first {
                   true => Ordering::Greater,
                   false => Ordering::Less,
               },
               (false, false) => match l.options.descending {
                   true => T::compare(&r.values, r_idx, &l.values, l_idx),
                   false => T::compare(&l.values, l_idx, &r.values, r_idx),
               },
           }
       }
   }
   ```
   
   I try to address comments and suggestions in latest PR. And for longer 
string compare regression for StringView, i still need time to investigate 
more, i am willing to create a new ticket to investigate and dig into. Thanks.
   


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