Skip to content

Regression: array_sort fails on list with inner non-nullable field #19947

Description

@timsaucer

Describe the bug

When you have a ListArray and the inner field is non-nullable, array_sort generates an error in 51.0.0. See below for steps to reproduce.

To Reproduce

The following generates an error:

select array_sort(arrow_cast(make_array(1, 3, 5, -5), 'List(non-null Int32)'));

DataFusion error: Internal("Assertion failed: result_data_type == *expected_type: Function 'array_sort' returned value of type 'List(Field { data_type: Int32 })' while the following type was promised at planning time and expected: 'List(Field { data_type: Int32, nullable: true })'")

Expected behavior

You cannot do the above sql with 50.0.0 (In 50.0.0 it doesn't support the "non-null" in parser) but I did test by manually creating and registering a record batch that has a list array with inner non-nullable field. It passes in 50.0.0 and fails in 51.0.0.

Additional context

I believe this was introduced in #17657

Activity

  1. added theissue type on Jan 23, 2026
  2. timsaucer commented on Jan 23, 2026

    @timsaucer
    MemberAuthor
  3. Jefffrey commented on Jan 23, 2026

    @Jefffrey
    Contributor

    Whoops! Thanks for spotting this, should be a quick fix 👍

  4. self-assigned this
    on Jan 23, 2026
  5. added a commit that references this issue on Jan 25, 2026
    8023947
  6. added
    regressionSomething that used to work no longer does
    on Mar 10, 2026
  7. alamb commented on Mar 10, 2026

    @alamb
    Contributor

    I am scoping out bugs / regressions to backport to branch-52 if we make another patchset release

    Would this be a good candidate?

  8. added 2 commits that reference this issue on Mar 11, 2026
    a1a392d
    ff4c630
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingregressionSomething that used to work no longer does

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions