Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cht42 committed Jan 7, 2025
1 parent 4e877a0 commit b73cab0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions datafusion/functions-nested/src/set_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,6 @@ fn general_array_distinct<OffsetSize: OffsetSizeTrait>(
array: &GenericListArray<OffsetSize>,
field: &FieldRef,
) -> Result<ArrayRef> {
if array.len() == 0 {
return Ok(Arc::new(array.clone()) as ArrayRef);
}
let dt = array.value_type();
let mut offsets = Vec::with_capacity(array.len());
offsets.push(OffsetSize::usize_as(0));
Expand All @@ -542,6 +539,9 @@ fn general_array_distinct<OffsetSize: OffsetSizeTrait>(
};
new_arrays.push(array);
}
if new_arrays.is_empty() {
return Ok(Arc::new(array.clone()) as ArrayRef);
}
let offsets = OffsetBuffer::new(offsets.into());
let new_arrays_ref = new_arrays.iter().map(|v| v.as_ref()).collect::<Vec<_>>();
let values = compute::concat(&new_arrays_ref)?;
Expand Down

0 comments on commit b73cab0

Please sign in to comment.