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/04/20 09:50:23 UTC

[GitHub] [arrow-rs] tustvold opened a new issue, #1596: Filtering Dense UnionArray Produces Invalid Offsets

tustvold opened a new issue, #1596:
URL: https://github.com/apache/arrow-rs/issues/1596

   **Describe the bug**
   
   build_extend_dense blindly copies offsets from the source array across, which can lead to invalid offsets in the filtered array
   
   **To Reproduce**
   
   ```
   let mut builder = UnionBuilder::new_dense(4);
   builder.append::<Int32Type>("A", 1).unwrap();
   builder.append::<Float64Type>("B", 3.2).unwrap();
   builder.append::<Float64Type>("B", 3.2).unwrap();
   let array = builder.build().unwrap();
   
   let filter_array = BooleanArray::from(vec![true, false, true]);
   let c = filter(&array, &filter_array).unwrap();
   let filtered = c.as_any().downcast_ref::<UnionArray>().unwrap();
   
   filtered.value(1);
   ```
   
   Panics with
   
   ```
   thread 'compute::kernels::filter::tests::test_filter_union_array_dense_with_nulls' panicked at 'assertion failed: (offset + length) <= self.len()', arrow/src/array/data.rs:486:9
   ****
   ```
   
   **Expected behavior**
   
   This should not panic


-- 
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.apache.org

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


[GitHub] [arrow-rs] alamb closed issue #1596: [Safety] Filtering Dense UnionArray Produces Invalid Offsets

Posted by GitBox <gi...@apache.org>.
alamb closed issue #1596: [Safety] Filtering Dense UnionArray Produces Invalid Offsets
URL: https://github.com/apache/arrow-rs/issues/1596


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