[
https://issues.apache.org/jira/browse/PARQUET-1918?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17219030#comment-17219030
]
ASF GitHub Bot commented on PARQUET-1918:
-----------------------------------------
belugabehr edited a comment on pull request #822:
URL: https://github.com/apache/parquet-mr/pull/822#issuecomment-714521089
@gszadovszky Ya. I did discover that this is a bit more tricky than I had
anticipated. My expectation was that ByteBuffers were handled the same way as
there are defined in the JDK specs (most methods have the side-affect of moving
Buffer positions around). This particular work is blocked as I try to improve
ByteBuffer handling in Thrift first: THRIFT-5288
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Avoid Copy of Bytes in Protobuf BinaryWriter
> --------------------------------------------
>
> Key: PARQUET-1918
> URL: https://issues.apache.org/jira/browse/PARQUET-1918
> Project: Parquet
> 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)