belugabehr commented on a change in pull request #1063:
URL: https://github.com/apache/hive/pull/1063#discussion_r436136581
##########
File path:
storage-api/src/java/org/apache/hadoop/hive/common/io/encoded/EncodedColumnBatch.java
##########
@@ -78,13 +79,21 @@ public void setIndexBaseOffset(int indexBaseOffset) {
@Override
public String toString() {
- String bufStr = "";
+ StringBuilder sb = new StringBuilder();
if (cacheBuffers != null) {
- for (MemoryBuffer mb : cacheBuffers) {
- bufStr += mb.getClass().getSimpleName() + " with " +
mb.getByteBufferRaw().remaining() + " bytes, ";
+ Iterator<MemoryBuffer> iter = cacheBuffers.iterator();
+ while (iter.hasNext()) {
+ MemoryBuffer mb = iter.next();
+ sb.append(mb.getClass().getSimpleName());
+ sb.append(" with ");
+ sb.append(mb.getByteBufferRaw().remaining());
+ sb.append(" bytes");
+ if (iter.hasNext()) {
+ sb.append(", ");
Review comment:
Will have to check this. I think from my own patch experience, that
this change might break a bunch of unit tests because they are checking the
output of `toString()` which previously always adds a comma, even if it's not
really needed. I'm not 100%, but just FYI.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]