rluvaton commented on code in PR #19259:
URL: https://github.com/apache/datafusion/pull/19259#discussion_r2606845933
##########
datafusion/functions-nested/src/remove.rs:
##########
@@ -403,16 +433,442 @@ fn general_remove<OffsetSize: OffsetSizeTrait>(
}
let values = if new_values.is_empty() {
- new_empty_array(&data_type)
+ new_empty_array(data_type)
} else {
let new_values = new_values.iter().map(|x|
x.as_ref()).collect::<Vec<_>>();
arrow::compute::concat(&new_values)?
};
Ok(Arc::new(GenericListArray::<OffsetSize>::try_new(
- Arc::new(Field::new_list_field(data_type, true)),
+ Arc::clone(list_field),
OffsetBuffer::new(offsets.into()),
values,
list_array.nulls().cloned(),
)?))
}
+
+#[cfg(test)]
+mod tests {
+ use crate::remove::{ArrayRemove, ArrayRemoveAll, ArrayRemoveN};
+ use arrow::array::{
+ Array, ArrayRef, AsArray, GenericListArray, ListArray, OffsetSizeTrait,
+ };
+ use arrow::datatypes::{DataType, Field, Int32Type};
+ use datafusion_common::ScalarValue;
+ use datafusion_expr::{ReturnFieldArgs, ScalarFunctionArgs, ScalarUDFImpl};
+ use datafusion_expr_common::columnar_value::ColumnarValue;
+ use std::ops::Deref;
+ use std::sync::Arc;
+
+ #[test]
+ fn test_array_remove_nullability() {
Review Comment:
Fails on main
--
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]