[C++] RunEndEncodedBuilder does not merge consecutive NaN values
- 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
Assessment
This issue has not been assessed yet.