You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/01/31 20:32:32 UTC

[GitHub] [arrow-datafusion] alamb commented on pull request #1653: suppport bitwise and as an example

alamb commented on pull request #1653:
URL: https://github.com/apache/arrow-datafusion/pull/1653#issuecomment-1026182589


   When I merged this branch from master I also found it had a compiler error due to some sort of logical conflicts:
   
   ```shell
      Compiling datafusion v6.0.0 (/Users/alamb/Software/arrow-datafusion/datafusion)
   error[E0308]: mismatched types
       --> datafusion/src/physical_plan/expressions/binary.rs:1154:56
        |
   1154 |             Operator::BitwiseAnd => bitwise_and_scalar(array, scalar.clone()),
        |                                                        ^^^^^ expected struct `Arc`, found trait object `dyn arrow::array::Array`
        |
        = note: expected reference `&Arc<(dyn arrow::array::Array + 'static)>`
                   found reference `&dyn arrow::array::Array`
   
   
   ```
   
   
   And I had to apply this to fix:
   
   ```diff
   diff --git a/datafusion/src/physical_plan/expressions/binary.rs b/datafusion/src/physical_plan/expressions/binary.rs
   index 82dacf760..d00106fb8 100644
   --- a/datafusion/src/physical_plan/expressions/binary.rs
   +++ b/datafusion/src/physical_plan/expressions/binary.rs
   @@ -419,7 +419,7 @@ fn bitwise_and(left: ArrayRef, right: ArrayRef) -> Result<ArrayRef> {
        }
    }
    
   -fn bitwise_and_scalar(array: &ArrayRef, scalar: ScalarValue) -> Option<Result<ArrayRef>> {
   +fn bitwise_and_scalar(array: &dyn Array, scalar: ScalarValue) -> Option<Result<ArrayRef>> {
        let result = match array.data_type() {
            DataType::Int8 => {
                binary_bitwise_array_scalar!(array, scalar, &, Int8Array, i8)
   
   ```


-- 
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