Skip to content

UnionMapWriter fails to write fixed size binary #586

Closed

Description

@nbauernfeind

A UnionMapWriter will null out the entire map struct entry instead of setting the value to null:

                childWriter.value().fixedSizeBinary().writeNull();

Actually hits NullableStructWriter#writeNull whereas UnionMapWriter should override writeNull and do a switch on the mode (though I'm not certain if null keys are valid).

EDIT:
Actually, the issue is that fixedSizeBinary needs to be overriden! Very frustrating, but this call is not overridden and is instead invoking UnionListWriter#fixedSizeBinary():

  @Override
  public FixedSizeBinaryWriter fixedSizeBinary() {
    return this;
  }

The real impl needs to override like so:

  @Override
  public FixedSizeBinaryWriter fixedSizeBinary() {
    switch (mode) {
      case KEY:
        return entryWriter.fixedSizeBinary(MapVector.KEY_NAME);
      case VALUE:
        return entryWriter.fixedSizeBinary(MapVector.VALUE_NAME);
      default:
        return this;
    }
  }

Activity

  1. changed the title [-]UnionMapWriter fails to write null values[/-] [+]UnionMapWriter fails to write fixed size binary[/+] on Feb 4, 2025
  2. self-assigned this
    on Feb 12, 2025
  3. jbonofre commented on Feb 12, 2025

    @jbonofre
    Member

    Let me try to reproduce the issue on a test (and fix it).

  4. mihazagar commented on Apr 27, 2025

    @mihazagar

    @jbonofre , I’d like to tackle this issue!

    Please let me know if there are any details you’d like me to keep in mind.

  5. added a commit that references this issue on Oct 12, 2025
  6. added this to the 18.4.0 milestone on Oct 14, 2025
  7. added 6 commits that reference this issue on Nov 2, 2025
  8. added a commit that references this issue on Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions