Jefffrey commented on code in PR #19948:
URL: https://github.com/apache/datafusion/pull/19948#discussion_r2723710612
##########
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:
The signature should already guard us from that path; it was only there for
completeness before. Worst case if something does go wrong at least we'll just
error normally at execution time instead of panicking via `unreachable!()` for
example
--
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]