viirya commented on code in PR #7795:
URL: https://github.com/apache/arrow-datafusion/pull/7795#discussion_r1360172294


##########
datafusion/physical-plan/src/sorts/cursor.rs:
##########
@@ -207,8 +211,12 @@ pub struct FieldCursor<T: FieldValues> {
 }
 
 impl<T: FieldValues> FieldCursor<T> {
-    /// Create a new [`FieldCursor`] from the provided `values` sorted 
according to `options`
+    /// Create a new [`FieldCursor`] from the provided `values` sorted 
according
+    /// to `options`.
+    ///
+    /// Panics if the array is empty
     pub fn new<A: FieldArray<Values = T>>(options: SortOptions, array: &A) -> 
Self {
+        assert!(array.len() > 0, "Empty array passed to FieldValues");

Review Comment:
   ```suggestion
           assert!(array.len() > 0, "Empty array passed to FieldCursor");
   ```



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