rluvaton commented on code in PR #19184:
URL: https://github.com/apache/datafusion/pull/19184#discussion_r2596501987


##########
datafusion/spark/src/function/array/shuffle.rs:
##########
@@ -263,3 +268,53 @@ fn fixed_size_array_shuffle(
         Some(nulls.into()),
     )?))
 }
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use arrow::datatypes::Field;
+    use datafusion_expr::ReturnFieldArgs;
+
+    #[test]
+    fn test_shuffle_nullability() {
+        let shuffle = SparkShuffle::new();
+
+        // Test with non-nullable array
+        let non_nullable_field = Arc::new(Field::new(
+            "arr",
+            List(Arc::new(Field::new("item", DataType::Int32, true))),
+            false, // not nullable
+        ));
+
+        let result = shuffle
+            .return_field_from_args(ReturnFieldArgs {
+                arg_fields: &[non_nullable_field.clone()],
+                scalar_arguments: &[],

Review Comment:
   there should be the same number of `scalar_arguments` and `arg_fields`, if 
something is not scalar than None is used.
   
   ```suggestion
                   arg_fields: &[non_nullable_field.clone()],
                   scalar_arguments: &[None],
   ```



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