Skip to content

split_offsets is not serialised as null when empty #1897

@jdockerty

Description

@jdockerty

When a DataFile is built through the derived builder (DataFileBuilder) and no split_offsets are given, this is still serialised as [] instead of null.

E.g. converting the Avro file to JSON it looks something like this:

   ...
    "split_offsets": {
      "array": []
    },

I suspect this is because the value within the DataFile is a Vec<i64> instead of an Option<Vec<i64>>, so we get an empty Vec instead of nothing.

I think this Option is the correct approach because the spec also states that split_offsets are optional and it looks like they're optional in the Java implementation too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions