You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Apache Arrow JIRA Bot (Jira)" <ji...@apache.org> on 2020/09/29 17:50:00 UTC
[jira] [Assigned] (ARROW-10136) [Rust][Arrow] Nulls are transformed
into "" after filtering for StringArray
[ https://issues.apache.org/jira/browse/ARROW-10136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Apache Arrow JIRA Bot reassigned ARROW-10136:
---------------------------------------------
Assignee: Apache Arrow JIRA Bot (was: Andrew Lamb)
> [Rust][Arrow] Nulls are transformed into "" after filtering for StringArray
> ---------------------------------------------------------------------------
>
> Key: ARROW-10136
> URL: https://issues.apache.org/jira/browse/ARROW-10136
> Project: Apache Arrow
> Issue Type: Bug
> Reporter: Andrew Lamb
> Assignee: Apache Arrow JIRA Bot
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> When I use the filter kernel with Null strings, any input column that was Null turns into an empty string after filtering.
> For example, this test (in filter.rs) should pass:
> {code}
> #[test]
> fn test_filter_string_array_with_null() {
> let a = StringArray::from(vec![Some("hello"), None, Some("world"), None]);
> let b = BooleanArray::from(vec![true, false, false, true]);
> let c = filter(&a, &b).unwrap();
> let d = c.as_ref().as_any().downcast_ref::<StringArray>().unwrap();
> assert_eq!(2, d.len());
> assert_eq!("hello", d.value(0));
> assert_eq!(true, d.is_null(1));
> }
> {code}
> But instead it fails (the second element in the output array should be null )
> {code}
> ---- compute::kernels::filter::tests::test_filter_string_array_with_null stdout ----
> thread 'compute::kernels::filter::tests::test_filter_string_array_with_null' panicked at 'assertion failed: `(left == right)`
> left: `true`,
> right: `false`', arrow/src/compute/kernels/filter.rs:686:9
> note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)