alamb commented on code in PR #2142:
URL: https://github.com/apache/arrow-datafusion/pull/2142#discussion_r842002406
##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -484,6 +485,20 @@ fn bitwise_or(left: ArrayRef, right: ArrayRef) ->
Result<ArrayRef> {
}
}
+/// Use datafusion build-in expression `concat` to evaluate `StringConcat`
operator
+fn string_concat(left: ArrayRef, right: ArrayRef) -> Result<ArrayRef> {
+ let result = string_expressions::concat(&[
+ ColumnarValue::Array(left),
+ ColumnarValue::Array(right),
+ ])?;
+ match result {
+ ColumnarValue::Array(array_ref) => Ok(array_ref),
+ _ => Err(DataFusionError::Execution(
+ "string_concat return type should be Array, but Scalar
found".to_string(),
+ )),
+ }
Review Comment:
I think you could use `ColumnarValue::into_array` here rather than error
https://github.com/apache/arrow-datafusion/blob/41b4e491663029f653e491b110d0b5e74d08a0b6/datafusion/expr/src/columnar_value.rs#L45-L50
--
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]