[ https://issues.apache.org/jira/browse/ARROW-9583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andy Grove resolved ARROW-9583. ------------------------------- Fix Version/s: 2.0.0 Resolution: Fixed Issue resolved by pull request 7854 [https://github.com/apache/arrow/pull/7854] > [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 > Labels: pull-request-available > Fix For: 2.0.0 > > Time Spent: 2h 10m > Remaining Estimate: 0h > > 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)