Skip to content

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

@timsaucer

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions