David Mollitor created HIVE-24226: ------------------------------------- Summary: Avoid Copy of Bytes in Protobuf BinaryWriter Key: HIVE-24226 URL: https://issues.apache.org/jira/browse/HIVE-24226 Project: Hive Issue Type: Improvement Reporter: David Mollitor Assignee: David Mollitor
{code:java|title=ProtoWriteSupport.java} class BinaryWriter extends FieldWriter { @Override final void writeRawValue(Object value) { ByteString byteString = (ByteString) value; Binary binary = Binary.fromConstantByteArray(byteString.toByteArray()); recordConsumer.addBinary(binary); } } {code} {{toByteArray()}} creates a copy of the buffer. There is already support with Parquet and Protobuf to pass instead a ByteBuffer which avoids the copy. -- This message was sent by Atlassian Jira (v8.3.4#803005)