You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "David Mollitor (Jira)" <ji...@apache.org> on 2020/10/02 13:58:00 UTC
[jira] [Assigned] (HIVE-24226) Avoid Copy of Bytes in Protobuf
BinaryWriter
[ https://issues.apache.org/jira/browse/HIVE-24226?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Mollitor reassigned HIVE-24226:
-------------------------------------
> 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
> Priority: Minor
>
> {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)