Skip to content

arrow-row on fixed size binary/list with size 0 and no nulls return wrong length #10270

Closed

Description

@rluvaton

Describe the bug

when size is 0 and no nulls the default length is 0 in fixed size binary array, which is wrong for non empty arrays

To Reproduce

#[test]
fn test_zero_width_fixed_size_binary_roundtrip() {
    for sort_option in all_sort_options() {
        // With a zero byte width and no nulls, the decoded length cannot be
        // inferred from the value or null buffers and must come from the row count
        for with_null in [true, false] {
            let mut builder = FixedSizeBinaryBuilder::new(0);
            for _ in 0..5 {
                builder.append_value([]).unwrap();
            }
            if with_null {
                builder.append_null();
            }
            let col = Arc::new(builder.finish()) as ArrayRef;

            let converter = RowConverter::new(vec![SortField::new_with_options(
                DataType::FixedSizeBinary(0),
                sort_option,
            )])
            .unwrap();
            let rows = converter.convert_columns(&[Arc::clone(&col)]).unwrap();
            let back = converter.convert_rows(&rows).unwrap();
            assert_eq!(&back[0], &col);

            back[0].to_data().validate_full().unwrap();
        }
    }
}

Expected behavior

should work

Additional context

found by fuzz tests in:

introduced in:

Activity

  1. added theissue type on Jul 2, 2026
  2. added
    bug
    on Jul 2, 2026
  3. rluvaton commented on Jul 2, 2026

    @rluvaton
    MemberAuthor

    take

    already fixing

  4. changed the title [-]arrow-row on fixed size binary with size 0 and no nulls return wrong length[/-] [+]arrow-row on fixed size binary/list with size 0 and no nulls return wrong length[/+] on Jul 2, 2026
  5. added a commit that references this issue on Jul 3, 2026
    d2519a1
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions