Fokko commented on code in PR #3521:
URL: https://github.com/apache/parquet-java/pull/3521#discussion_r3156322563
##########
parquet-column/src/main/java/org/apache/parquet/column/values/deltastrings/DeltaByteArrayWriter.java:
##########
@@ -89,7 +89,10 @@ public String memUsageString(String prefix) {
@Override
public void writeBytes(Binary v) {
int i = 0;
- byte[] vb = v.getBytes();
+ // copy() is a no-op for constant (non-reused) Binaries, and
getBytesUnsafe()
+ // returns the backing array directly for ByteArrayBackedBinary — avoiding
+ // the unconditional array copy that getBytes() always performs.
+ byte[] vb = v.copy().getBytesUnsafe();
Review Comment:
Let's address this one seperately:
```suggestion
byte[] vb = v.getBytes();
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]