Skip to content

string array equal comparison fails to consider offsets #9323

Closed

Description

@pierrebelzile

Describe the bug
Two arrays compare equal if the characters are the same but with different offset lengths.

To Reproduce

use arrow::array::Array;

#[test]
fn string_cmp() {
    let a = arrow::array::StringArray::from(vec![
        Some("ab"),
        Some("c"),
    ]);
    let b = arrow::array::StringArray::from(vec![
        Some("a"),
        Some("bc"),
    ]);

    assert!(a != b);
}

Expected behavior
Equality should fail because arrays are different.

Activity

  1. added
    bug
    on Feb 1, 2026
  2. jhorstmann commented on Feb 1, 2026

    @jhorstmann
    Contributor

    Wow, good find. This bug seems to have existed for at least the last 5 years. I'll look into a fix.

  3. added 3 commits that reference this issue on Feb 2, 2026
    100269a
    fe14c12
    6bbfb99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions