@@ -29,9 +29,7 @@ use arrow::datatypes::{DataType, Field, FieldRef};
2929use arrow:: row:: { RowConverter , SortField } ;
3030use datafusion_common:: cast:: { as_large_list_array, as_list_array} ;
3131use 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 } ;
3533use 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