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


##########
paimon-format/src/main/java/org/apache/paimon/format/orc/writer/OrcBulkWriter.java:
##########
@@ -67,4 +89,43 @@ public void finish() throws IOException {
         flush();
         writer.close();
     }
+
+    @Override
+    public long length() throws IOException {
+        long estimateMemory = treeWriter.estimateMemory();
+
+        long dataLength = 0;
+        List<StripeInformation> stripes =
+                
Collections.unmodifiableList(OrcUtils.convertProtoStripesToStripes(this.stripes));
+        if (!stripes.isEmpty()) {
+            StripeInformation stripeInformation = stripes.get(stripes.size() - 
1);
+            dataLength =
+                    stripeInformation != null
+                            ? stripeInformation.getOffset() + 
stripeInformation.getLength()
+                            : 0;
+        }
+
+        // This value is estimated, not actual.
+        return (long)
+                Math.ceil(
+                        dataLength
+                                + (estimateMemory + (long) rowBatch.size * 
avgRowByteSize) * 0.2);

Review Comment:
   @JingsongLi  I have removed `avgRowByteSize`  and make the check interval 
equal with the size of `rowBatch`. Please help to review again. 



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