You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Antoine Pitrou (JIRA)" <ji...@apache.org> on 2019/02/06 14:49:00 UTC

[jira] [Commented] (ARROW-2622) [C++] Array methods IsNull and IsValid are not complementary

    [ https://issues.apache.org/jira/browse/ARROW-2622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16761797#comment-16761797 ] 

Antoine Pitrou commented on ARROW-2622:
---------------------------------------

Looks like this was fixed in ARROW-2641.

> [C++] Array methods IsNull and IsValid are not complementary
> ------------------------------------------------------------
>
>                 Key: ARROW-2622
>                 URL: https://issues.apache.org/jira/browse/ARROW-2622
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++
>    Affects Versions: 0.9.0
>            Reporter: Thomas Buhrmann
>            Priority: Major
>             Fix For: 0.13.0
>
>
> Hi, not sure if this is a bug or if I misinterpret the spec. According to the latter, "Arrays having a 0 null count may choose to not allocate the null bitmap". From this I'd infer that the statement also holds in the other direction, i.e. non-allocated bitmaps imply a 0 null count. This would mean that if a bitmap is not allocated, IsValid() should always return true. But at the moment it's doing this:
> {code:java}
> bool IsNull(int64_t i) const {
>   return null_bitmap_data_ != NULLPTR &&
>     BitUtil::BitNotSet(null_bitmap_data_, i + data_->offset);
> }
> bool IsValid(int64_t i) const {
>   return null_bitmap_data_ != NULLPTR &&
>     BitUtil::GetBit(null_bitmap_data_, i + data_->offset);
> }
> {code}
> Which leads to a situation where in the case of non-allocated bitmaps values are neither Null nor Valid. Shouldn't it rather be:
> {code:java}
> bool IsValid(int64_t i) const {
>   return null_bitmap_data_ == NULLPTR ||
>     BitUtil::GetBit(null_bitmap_data_, i + data_->offset);
> }{code}
> ?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)