You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Paddy Horan (Jira)" <ji...@apache.org> on 2020/07/29 01:06:00 UTC

[jira] [Commented] (ARROW-9583) [Rust] Offset is mishandled in arithmetic and boolean compute kernels

    [ https://issues.apache.org/jira/browse/ARROW-9583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17166784#comment-17166784 ] 

Paddy Horan commented on ARROW-9583:
------------------------------------

Thanks [~jhorstmann], I submitted a PR for the offset issue in the compute kernels.

The offset requirement on the boolean kernels shouldn't be needed but I was defensive when implementing this as it's complicated by the fact that boolean arrays are bit packed.

I'll take a look at the SIMD issue when I get a chance too.

I'll open separate JIRA's for these issues.

> [Rust] Offset is mishandled in arithmetic and boolean compute kernels
> ---------------------------------------------------------------------
>
>                 Key: ARROW-9583
>                 URL: https://issues.apache.org/jira/browse/ARROW-9583
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Rust
>    Affects Versions: 1.0.0
>            Reporter: Jörn Horstmann
>            Assignee: Paddy Horan
>            Priority: Major
>
> Several compute kernels create the resulting ArrayData with the same offset of one of the operands. Instead this offset should be 0 since the buffer is freshly constructed with the correct len.
> Example of one failing test:
>  
> {code:java}
>     #[test]
>     fn test_primitive_array_add_sliced() {
>         let a = Int32Array::from(vec![0, 0, 0, 5, 6, 7, 8, 9, 0]);
>         let b = Int32Array::from(vec![0, 0, 0, 6, 7, 8, 9, 8, 0]);
>         let a = a.slice(3, 5);
>         let b = b.slice(3, 5);
>         let a = a.as_any().downcast_ref::<Int32Array>().unwrap();
>         let b = b.as_any().downcast_ref::<Int32Array>().unwrap();
>         assert_eq!(5, a.value(0));
>         assert_eq!(6, b.value(0));
>         let c = add(&a, &b).unwrap();
>         assert_eq!(5, c.len());
>         assert_eq!(11, c.value(0));
>         assert_eq!(13, c.value(1));
>         assert_eq!(15, c.value(2));
>         assert_eq!(17, c.value(3));
>         assert_eq!(17, c.value(4));
>     }
>  {code}
> Additionally, the boolean kernels seem to require that both operands have the same offset. This shouldn't be needed, but it seems that the simd implementation requires that the offset is a multiple of 8 (bits) so that the operation works correctly on whole bytes. The scalar implementation should be fine with any offset.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)