timsaucer commented on code in PR #19948:
URL: https://github.com/apache/datafusion/pull/19948#discussion_r2721331245


##########
datafusion/functions-nested/src/sort.rs:
##########
@@ -134,18 +132,7 @@ impl ScalarUDFImpl for ArraySort {
     }
 
     fn return_type(&self, arg_types: &[DataType]) -> Result<DataType> {
-        match &arg_types[0] {
-            DataType::Null => Ok(DataType::Null),
-            DataType::List(field) => {
-                Ok(DataType::new_list(field.data_type().clone(), true))
-            }
-            DataType::LargeList(field) => {
-                Ok(DataType::new_large_list(field.data_type().clone(), true))
-            }
-            arg_type => {
-                plan_err!("{} does not support type {arg_type}", self.name())
-            }

Review Comment:
   By removing this, don't we delay the error generated when someone passes an 
invalid type until execution? It seems like we want this check to still happen 
during planning.
   
   Maybe something like match on `DataType::Null | DataType::List(_) | 
ataType::LargeList(_) => Ok(arg_types[0].clone())`



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