Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rust]: Comparison of list arrays with differing offsets fails #166

Closed
alamb opened this issue Apr 26, 2021 · 3 comments · Fixed by #1756
Closed

[Rust]: Comparison of list arrays with differing offsets fails #166

alamb opened this issue Apr 26, 2021 · 3 comments · Fixed by #1756
Labels
arrow Changes to the arrow crate bug

Comments

@alamb
Copy link
Contributor

alamb commented Apr 26, 2021

Note: migrated from original JIRA: https://issues.apache.org/jira/browse/ARROW-11267

Found this while reviewing the fix for ARROW-11239. The reason for the failure seems to be related to the combining of null bitmaps of parent/child data. When I changed create_list_array to not include null buffers the test passes.
{code:java}
#[test]
fn test_list_different_offsets() {
let a =
create_list_array(&[Some(&[0, 0]), Some(&[1, 2]), Some(&[3, 4])]);
let b =
create_list_array(&[Some(&[1, 2]), Some(&[3, 4]), Some(&[5, 6])]); let a_slice = a.slice(1, 2);
let b_slice = b.slice(0, 2);
test_equal(&a_slice, &b_slice, true);
} {code}
[~jorgecarleitao] [~nevi_me] FYI

@alamb alamb added the arrow Changes to the arrow crate label Apr 26, 2021
@alamb
Copy link
Contributor Author

alamb commented Apr 26, 2021

Comment from Andrew Lamb(alamb) @ 2021-01-19T21:13:19.582+0000:

When I tested on https://github.com/apache/arrow/pull/9211/files -- this test case still fails (aka https://github.com/apache/arrow/pull/9211 does not seem to fix it)

@tustvold
Copy link
Contributor

tustvold commented May 26, 2022

I think this was fixed by #1589

At the very least this now passes

#[test]
    fn test_list_different_offsets() {
        let a = ListArray::from_iter_primitive::<Int32Type, _, _>([
            Some([Some(0), Some(0)]),
            Some([Some(1), Some(2)]),
            Some([None, None]),
        ]);
        let b = ListArray::from_iter_primitive::<Int32Type, _, _>([
            Some([Some(1), Some(2)]),
            Some([None, None]),
            Some([None, None]),
        ]);
        let a_slice = a.slice(1, 2);
        let b_slice = b.slice(0, 2);
        assert_eq!(&a_slice, &b_slice);
    }

And variations of the same

@alamb
Copy link
Contributor Author

alamb commented May 26, 2022

I ported the test above into a PR #1756

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants