Skip to content

UnionMapWriter fails to write fixed size binary #586

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():

@OverridepublicFixedSizeBinaryWriterfixedSizeBinary() {
returnthis;
}

The real impl needs to override like so:

@OverridepublicFixedSizeBinaryWriterfixedSizeBinary() {
switch (mode) {
caseKEY:
returnentryWriter.fixedSizeBinary(MapVector.KEY_NAME);
caseVALUE:
returnentryWriter.fixedSizeBinary(MapVector.VALUE_NAME);
default:
returnthis;
}
}

Activity

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