Skip to content

Commit f857c20

Browse files
committed
apply suggestion simplifying return_type
1 parent 9f59bd7 commit f857c20

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

datafusion/functions-nested/src/set_ops.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ use arrow::datatypes::{DataType, Field, FieldRef};
2929
use arrow::row::{RowConverter, SortField};
3030
use datafusion_common::cast::{as_large_list_array, as_list_array};
3131
use datafusion_common::utils::ListCoercion;
32-
use datafusion_common::{
33-
exec_err, internal_err, plan_err, utils::take_function_args, Result,
34-
};
32+
use datafusion_common::{exec_err, internal_err, utils::take_function_args, Result};
3533
use datafusion_expr::{
3634
ColumnarValue, Documentation, ScalarUDFImpl, Signature, Volatility,
3735
};
@@ -289,17 +287,7 @@ impl ScalarUDFImpl for ArrayDistinct {
289287
}
290288

291289
fn return_type(&self, arg_types: &[DataType]) -> Result<DataType> {
292-
match &arg_types[0] {
293-
List(field) => Ok(DataType::new_list(
294-
field.data_type().clone(),
295-
field.is_nullable(),
296-
)),
297-
LargeList(field) => Ok(DataType::new_large_list(
298-
field.data_type().clone(),
299-
field.is_nullable(),
300-
)),
301-
arg_type => plan_err!("{} does not support type {arg_type}", self.name()),
302-
}
290+
Ok(arg_types[0].clone())
303291
}
304292

305293
fn invoke_with_args(

0 commit comments

Comments
 (0)