Skip to content

[C++] REEBuilder Produces Incorrect Values When Using AppendArraySlice #50491

Description

@andishgar

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

The following code:

auto run_end_builder = std::make_shared<Int32Builder>();
auto value_builder = std::make_shared<FloatBuilder>();
auto run_end_encoded_type = run_end_encoded(int32(), float32());
RunEndEncodedBuilder builder(default_memory_pool(), run_end_builder,
                             value_builder, run_end_encoded_type);

ASSERT_OK(builder.AppendScalar(**MakeScalar(float32(), 2), 3));
ASSERT_OK_AND_ASSIGN(auto array_1, builder.Finish());

ASSERT_OK(builder.AppendScalar(**MakeScalar(float32(), 2), 3));
ArraySpan span(*array_1->data());
ASSERT_OK(builder.AppendArraySlice(span, 0, 3));

ASSERT_OK_AND_ASSIGN(auto array_2, builder.Finish());
ARROW_LOGGER_INFO("", array_2->ToString());

produces the following output. This indicates that the run from the appended array is not merged with the existing open run in the builder, even though both runs contain the same value.

-- run_ends:
  [
    3,
    6
  ]
-- values:
  [
    2,
    2
  ]

Component(s)

C++

Metadata

Metadata

Assignees

No one assigned

    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