Skip to content

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

Description

@andishgar

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

The following code:

auto ree_type = run_end_encoded(int32(), float32());
auto int32_builder = std::make_shared<Int32Builder>(pool_);
auto float_builder = std::make_shared<FloatBuilder>(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++

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions