liming30 commented on code in PR #1350:
URL: https://github.com/apache/incubator-paimon/pull/1350#discussion_r1227977685


##########
paimon-format/src/main/java/org/apache/paimon/format/orc/writer/OrcBulkWriter.java:
##########
@@ -67,4 +80,35 @@ public void finish() throws IOException {
         flush();
         writer.close();
     }
+
+    @Override
+    public long length() throws IOException {
+        long estimateMemory = treeWriter.estimateMemory();
+        long fileLength = underlyingStream.getPos();
+
+        // This value is estimated, not actual.
+        return (long) Math.ceil(fileLength + estimateMemory * 0.2);

Review Comment:
   For `stripes` that have been flushed, the size can be obtained through 
`underlyingStream.getPos()`, and for the stripe that is not fully formed, the 
size can be obtained through `estimateMemory()`.



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

Reply via email to