Omega359 commented on code in PR #15348: URL: https://github.com/apache/datafusion/pull/15348#discussion_r2007390113
########## datafusion/physical-plan/src/sorts/cursor.rs: ########## @@ -281,6 +281,33 @@ impl<T: ByteArrayType> CursorArray for GenericByteArray<T> { } } +impl CursorArray for StringViewArray { + type Values = StringViewArray; + fn values(&self) -> Self { + self.clone() + } +} + +impl CursorValues for StringViewArray { + fn len(&self) -> usize { + self.views().len() + } + + fn eq(l: &Self, l_idx: usize, r: &Self, r_idx: usize) -> bool { + unsafe { GenericByteViewArray::compare_unchecked(l, l_idx, r, r_idx).is_eq() } Review Comment: Please add a 'safety:' note to say why is is ok to use unsafe here. [An example](https://github.com/apache/datafusion/blob/74aeb91fd94109d05178555d83e812e6e0712573/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator/nulls.rs#L162) -- 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