rdblue commented on a change in pull request #1430:
URL: https://github.com/apache/iceberg/pull/1430#discussion_r487594524



##########
File path: api/src/main/java/org/apache/iceberg/Metrics.java
##########
@@ -120,4 +124,90 @@ public Long recordCount() {
   public Map<Integer, ByteBuffer> upperBounds() {
     return upperBounds;
   }
+
+  /**
+   * Implemented the method to enable serialization of ByteBuffers.
+   * @param out The stream where to write
+   * @throws IOException On serialization error
+   */
+  private void writeObject(ObjectOutputStream out) throws IOException {
+    out.writeObject(rowCount);
+    out.writeObject(columnSizes);
+    out.writeObject(valueCounts);
+    out.writeObject(nullValueCounts);
+
+    writeByteBufferMap(out, lowerBounds);
+    writeByteBufferMap(out, upperBounds);
+  }

Review comment:
       This isn't really a serialization format that needs to be specified or 
reusable (besides maybe `writeByteBufferMap`). Java serialization should only 
be used within a running job that has just one version of the Iceberg library, 
so what matters is that a test can write an object and read an identical one.
   
   We don't want to go too far down the path of documenting things like this 
that we don't intend to support as a format.




----------------------------------------------------------------
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]

Reply via email to