[hotfix] Fix BinaryRecordData deserialize

pull/2868/head
GOODBOY008 1 year ago committed by gongzhongqiang
parent 568ed79005
commit f2c81c7d08

@ -89,13 +89,16 @@ public class BinaryRecordDataSerializer extends TypeSerializerSingleton<BinaryRe
}
@Override
@SuppressWarnings("unused")
public BinaryRecordData deserialize(BinaryRecordData reuse, DataInputView source)
throws IOException {
MemorySegment[] segments = reuse.getSegments();
checkArgument(
segments == null || (segments.length == 1 && reuse.getOffset() == 0),
"Reuse BinaryRecordData should have no segments or only one segment and offset start at 0.");
// Note: arity is not used in BinaryRecordData, so we can ignore it here.But we still need
// to read it.
int arity = source.readInt();
int length = source.readInt();
if (segments == null || segments[0].size() < length) {
segments = new MemorySegment[] {MemorySegmentFactory.wrap(new byte[length])};

Loading…
Cancel
Save