apache / apache/arrow

[C++] RunEndEncodedBuilder does not merge consecutive NaN values

Open
#50,517 3 comments 0 reactions 1 assignee Claimed by @andishgar View on GitHub
Component: C++ Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the bug, including details regarding any error messages, version, and platform.

The following code:

```c++
auto ree_type = run_end_encoded(int32(), float32());
auto int32_builder = std::make_shared(pool_);
auto float_builder = std::make_shared(pool_);
RunEndEncodedBuilder builder(pool_, int32_builder, float_builder, ree_type);
ASSERT_OK(builder.AppendScalar(**MakeScalar(float32(), std::nanf("0")), 3));
ASSERT_OK(builder.AppendScalar(**MakeScalar(float32(), std::nanf("0")), 3));
ASSERT_OK_AND_ASSIGN(auto array, builder.Finish());
ARROW_LOGGER_INFO("", array->ToString());
```
produces the following output. This indicates that consecutive NaN values are treated as distinct values instead of being merged into a single run:

```
-- run_ends:
[
3,
6
]
-- values:
[
nan,
nan
]
```

### Component(s)

C++

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.