Skip to content

nullif operating on ArrayRef #510

@bjchambers

Description

@bjchambers

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

The nullif kernel currently only applies to PrimitiveArray<T>. This makes it impossible to use with non-primitive types, which often arise when working with structured / nested data. Additionally, it seems like the nullif kernel should have a similar signature to filter -- where filter selects only the non-true rows, nullif nulls out the true rows.

Describe the solution you'd like
The signature of nullif changed to nullif(values: ArrayRef, condition: BooleanArray) -> Result<ArrayRef>.
Possibly the addition of the complement null_unless.

I have a draft that I think would work (can open a PR), but wanted to make sure that such a kernel is desirable, and understand whether it should use a different name to avoid API breakages (generic_nullif or something like that).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAny new improvement worthy of a entry in the changelog

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions