bjchambers opened a new issue #738:
URL: https://github.com/apache/arrow-rs/issues/738


   **Describe the bug**
   
   `unary` kernel doesn't respect the offset when determining the null buffer, 
which means that the results are incorrect when applied to a slice.
   
   **To Reproduce**
   Steps to reproduce the behavior:
   
   ```
    #[test]
       fn test_unary_f64_slice() {
           let input =
               Float64Array::from(vec![Some(5.1f64), None, Some(6.8), None, 
Some(7.2)]);
           let input_slice = input.slice(1, 4);
           let input_slice: &Float64Array = as_primitive_array(&input_slice);
           let result = unary(input_slice, |n| n.round());
           assert_eq!(
               result,
               Float64Array::from(vec![None, Some(7.0), None, Some(7.0)])
           )
       }
   ```
   
   **Expected behavior**
   
   The test should pass.
   
   **Actual behavior**
   
   The test fails:
   
   ```
   thread 'compute::kernels::arity::tests::test_unary_f64_slice' panicked at 
'assertion failed: `(left == right)`
     left: `PrimitiveArray<Float64>
   [
     0.0,
     null,
     0.0,
     null,
   ]`,
    right: `PrimitiveArray<Float64>
   [
     null,
     7.0,
     null,
     7.0,
   ]`', arrow/src/compute/kernels/arity.rs:88:9
   ```
   **Additional context**


-- 
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-unsubscr...@arrow.apache.org

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


Reply via email to