Skip to content

Remove null_count from ArrayData::try_new() #911

@alamb

Description

@alamb

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Re #817 ; As @jhorstmann pointed out on #810 at https://github.com/apache/arrow-rs/pull/810/files#r742905920

ArrayData::try_new() function includes an optional null_count argument and a validity buffer. If these numbers differ, wrong results can occur (and maybe also undefined behavior) in some later operation.

Note that as part of #817 we will be validating that the bitmaps are consistent with the declared null_count

Describe the solution you'd like

Since most callers pass None anyway at which point we calculate the number, if we simply removed the option to pass in an inconsistent value we would avoid a class of inconsistencies I would suggest to remove the null_count parameter from try_new to completely avoid of inconsistencies.

Describe alternatives you've considered
N/A

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-changeChanges to the arrow APIarrowChanges to the arrow crateenhancementAny 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