You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Ted-Jiang (via GitHub)" <gi...@apache.org> on 2023/02/07 11:34:29 UTC

[GitHub] [arrow-datafusion] Ted-Jiang commented on a diff in pull request #5207: minor: remove unnecessary clone

Ted-Jiang commented on code in PR #5207:
URL: https://github.com/apache/arrow-datafusion/pull/5207#discussion_r1098541436


##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -679,11 +679,11 @@ impl PhysicalExpr for BinaryExpr {
         let scalar_result = match (&left_value, &right_value) {
             (ColumnarValue::Array(array), ColumnarValue::Scalar(scalar)) => {
                 // if left is array and right is literal - use scalar operations
-                self.evaluate_array_scalar(array, scalar)?
+                self.evaluate_array_scalar(array, scalar.clone())?

Review Comment:
   > An alternate is to figure out why binary_array_op_dyn_scalar needs an owned ScalarValue
   because all xx_scalar_dyn in arrow-rs need
   ```
   pub fn add_scalar_dyn<T>(
       array: &dyn Array,
       scalar: T::Native,
   ) -> Result<ArrayRef, ArrowError>
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org