liukun4515 commented on code in PR #2171:
URL: https://github.com/apache/arrow-datafusion/pull/2171#discussion_r844573204
##########
datafusion/physical-expr/src/conditional_expressions.rs:
##########
@@ -35,36 +33,51 @@ pub fn coalesce(args: &[ColumnarValue]) ->
Result<ColumnarValue> {
)));
}
- let size = match args[0] {
- ColumnarValue::Array(ref a) => a.len(),
- ColumnarValue::Scalar(ref _s) => 1,
- };
- let mut res = new_null_array(&args[0].data_type(), size);
+ let return_type = args[0].data_type();
+ let mut return_array = args.iter().filter_map(|x| match x {
+ ColumnarValue::Array(array) => Some(array.len()),
+ _ => None,
Review Comment:
why not use the same logic by returning `Some(1)`?
--
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]