Jefffrey commented on code in PR #24502:
URL: https://github.com/apache/datafusion/pull/24502#discussion_r4216474465


##########
datafusion/functions-nested/src/sort.rs:
##########
@@ -233,15 +227,16 @@ fn sort_primitive_list<T: ArrowPrimitiveType, OffsetSize: 
OffsetSizeTrait>(
     prim_values: &PrimitiveArray<T>,
     list_array: &GenericListArray<OffsetSize>,
     field: FieldRef,
-    sort_options: Option<SortOptions>,
+    sort_order: Option<&StringArray>,
+    null_order: Option<&StringArray>,
 ) -> Result<ArrayRef>
 where
     T::Native: ArrowNativeTypeOp,
 {
-    let descending = sort_options.is_some_and(|o| o.descending);
-    let nulls_first = sort_options.is_none_or(|o| o.nulls_first);
+    let row_count = list_array.len();
     let list_nulls = list_array.nulls();
     let offsets = list_array.offsets();
+    let mut list_validity = BooleanBufferBuilder::new(row_count);

Review Comment:
   instead of using a builder here we can consider using something like 
[`NullBuffer::union`](https://docs.rs/arrow/latest/arrow/buffer/struct.NullBuffer.html#method.union)
 to construct the null buffer upfront from all the input arrays



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to