Skip to content

[C++] ListArray comparison is incorrect #21764

@asfimport

Description

@asfimport

Equality comparison for ListArray accounts for offsets incorrectly, so slices of ListArrays with identical offsets but differing values will sometimes compare equal.

For example, the following test fails:

TEST_F(TestListArray, ValuesEquality) {
  auto type = list(int32());
  auto left = ArrayFromJSON(type, "[[1, 2], [3, null], [5], []]");
  auto right = ArrayFromJSON(type, "[[1, 2], [3, null], [9], []]");

  AssertArraysEqual(*left->Slice(2), *right->Slice(2));
}

Reporter: Ben Kietzman / @bkietz
Assignee: Ben Kietzman / @bkietz

Related issues:

Note: This issue was originally created as ARROW-5299. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions