Skip to content

unable to read block with only nulls #181

Closed

Description

@erikbrinkman

If an avro file has only nulls in it (or derived nulls, reading fails).

let mut buff = Cursor::new(Vec::new());
let schema = Schema::parse_str(r#""null""#).unwrap();
let mut writer = Writer::new(&schema, &mut buff);
writer.append(Value::Null).unwrap();
writer.into_inner().unwrap();
buff.set_position(0);
for val in Reader::new(buff).unwrap() {
    val.unwrap();
}

panics unwrapping the null value with:

called `Result::unwrap()` on an `Err` value: Avro(unable to read block)

Activity

  1. added a commit that references this issue on Apr 15, 2025
    f08cdff
  2. martin-g commented on Apr 15, 2025

    @martin-g
    Member

    Thanks for the report!
    PR with a possible fix at #182

  3. added a commit that references this issue on Apr 16, 2025
    6629327
  4. added this to the 0.19.0 milestone on Jun 6, 2025
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions