Skip to content

[C++] Incorrect Logic for AdaptiveUIntBuilder::AppendValues #51144

Description

@andishgar

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

The following code

TEST(TestAdaptiveUIntBuilderWithStartIntSize, MyTest) {
  AdaptiveUIntBuilder builder;
  ASSERT_OK(builder.Append(1));
  ASSERT_OK(builder.Append(2));
  ASSERT_OK(builder.Append(3));
  ASSERT_OK(builder.Append(4));
  std::vector<uint64_t> values{5,6,7,8};
  ASSERT_OK(builder.AppendValues(values.data(),4));
  auto array = builder.Finish().ValueOrDie();
  ARROW_LOGGER_INFO("",array->ToString());
}

produces the following result because the pending data is not committed here:

[
  1,
  2,
  3,
  4
]

Component(s)

C++

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions