Skip to content

UnionArray::is_null incorrect #1625

@alamb

Description

@alamb

Describe the bug

UnionArray::is_null checks the Union's validity map rather than its slot.

Here is the default impl for is_null
https://github.com/apache/arrow-rs/blob/master/arrow/src/array/array.rs#L164-L166

There is no override in the union's impl of Array:https://github.com/apache/arrow-rs/blob/master/arrow/src/array/array_union.rs#L305-L313

See discussion from @tustvold and @viirya here: https://github.com/apache/arrow-rs/pull/1589/files#r854817015

To Reproduce
Steps to reproduce the behavior:

Expected behavior
UnionArray::is_null should check the slot (child's data) for nullness, rather than its own

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrowChanges to the arrow cratebug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions