Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnionMapWriter fails to write fixed size binary #586

Open
nbauernfeind opened this issue Feb 4, 2025 · 0 comments
Open

UnionMapWriter fails to write fixed size binary #586

nbauernfeind opened this issue Feb 4, 2025 · 0 comments
Labels
Type: bug Something isn't working

Comments

@nbauernfeind
Copy link
Contributor

nbauernfeind commented Feb 4, 2025

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;
    }
  }
@nbauernfeind nbauernfeind added the Type: bug Something isn't working label Feb 4, 2025
@nbauernfeind nbauernfeind changed the title UnionMapWriter fails to write null values UnionMapWriter fails to write fixed size binary Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant