Veeupup commented on code in PR #8333:
URL: https://github.com/apache/arrow-datafusion/pull/8333#discussion_r1409313857
##########
datafusion/expr/src/built_in_function.rs:
##########
@@ -536,7 +536,23 @@ impl BuiltinScalarFunction {
let data_type = get_base_type(&input_expr_types[0])?;
Ok(data_type)
}
- BuiltinScalarFunction::ArrayAppend =>
Ok(input_expr_types[0].clone()),
+ BuiltinScalarFunction::ArrayAppend => {
+ if let DataType::List(field) = input_expr_types[0].clone() {
+ if field.data_type().equals_datatype(&DataType::Null) {
+ Ok(DataType::List(Arc::new(Field::new(
+ "item",
+ input_expr_types[1].clone(),
+ true,
+ ))))
+ } else {
+ Ok(input_expr_types[0].clone())
+ }
+ } else {
+ plan_err!(
+ "The {self} function can only accept list as the first
argument"
Review Comment:
thanks! fixed.
--
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]