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


##########
datafusion/functions-nested/src/set_ops.rs:
##########
@@ -363,23 +360,19 @@ fn generic_set_lists<OffsetSize: OffsetSizeTrait>(
 
     let mut offsets = vec![OffsetSize::usize_as(0)];
     let mut new_arrays = vec![];
-    let mut new_null_buf = vec![];
     let converter = RowConverter::new(vec![SortField::new(l.value_type())])?;
-    for (first_arr, second_arr) in l.iter().zip(r.iter()) {
-        let mut ele_should_be_null = false;
+    for (l_arr, r_arr) in l.iter().zip(r.iter()) {
+        let last_offset = *offsets.last().unwrap();
 
-        let l_values = if let Some(first_arr) = first_arr {
-            converter.convert_columns(&[first_arr])?
-        } else {
-            ele_should_be_null = true;
-            converter.empty_rows(0, 0)
-        };
-
-        let r_values = if let Some(second_arr) = second_arr {
-            converter.convert_columns(&[second_arr])?
-        } else {
-            ele_should_be_null = true;
-            converter.empty_rows(0, 0)
+        let (l_values, r_values) = match (l_arr, r_arr) {
+            (Some(l_arr), Some(r_arr)) => (
+                converter.convert_columns(&[l_arr])?,
+                converter.convert_columns(&[r_arr])?,
+            ),
+            _ => {

Review Comment:
   Little drive-by refactor here to skip the set logic below for nulls



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