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

Regression: Concatenating sliced ListArrays is broken #7034

Closed
alamb opened this issue Jan 28, 2025 · 1 comment · Fixed by #7037
Closed

Regression: Concatenating sliced ListArrays is broken #7034

alamb opened this issue Jan 28, 2025 · 1 comment · Fixed by #7037
Assignees
Labels

Comments

@alamb
Copy link
Contributor

alamb commented Jan 28, 2025

Describe the bug

concatenating sliced ListArrays is broken

To Reproduce
This test which concatenates sliced list arrays should pass

    #[test]
    fn test_concat_primitive_list_arrays_slices() {
        let list1 = vec![
            Some(vec![Some(-1), Some(-1), Some(2), None, None]),
            Some(vec![]),  // In slice
            None, // In slice
            Some(vec![Some(10)]),
        ];
        let list1_array = ListArray::from_iter_primitive::<Int64Type, _, _>(list1.clone());
        let list1_array = list1_array.slice(1, 2);
        let list1_values = list1.into_iter().skip(1).take(2);

        let list2 = vec![
            None,
            Some(vec![Some(100), None, Some(101)]),
            Some(vec![Some(102)]),
        ];
        let list2_array = ListArray::from_iter_primitive::<Int64Type, _, _>(list2.clone());

        let array_result = concat(&[&list1_array, &list2_array]).unwrap();

        let expected = list1_values.chain(list2);
        let array_expected = ListArray::from_iter_primitive::<Int64Type, _, _>(expected);

        assert_eq!(array_result.as_ref(), &array_expected as &dyn Array);
    }

Expected behavior
Test should pass

Additional context
I found this while testing arrow 54.1.0 with DataFusion apache/datafusion#14328 (comment)

This regression was introduced in

The test case above

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

Successfully merging a pull request may close this issue.

1 participant