openinx commented on a change in pull request #3784:
URL: https://github.com/apache/iceberg/pull/3784#discussion_r830941435



##########
File path: orc/src/main/java/org/apache/iceberg/orc/OrcFileAppender.java
##########
@@ -99,9 +110,27 @@ public Metrics metrics() {
 
   @Override
   public long length() {
-    Preconditions.checkState(isClosed,
-        "Cannot return length while appending to an open file.");
-    return file.toInputFile().getLength();
+    if (isClosed) {
+      return file.toInputFile().getLength();
+    }
+    if (this.treeWriter == null) {
+      throw new RuntimeException("Can't get the length!");
+    }
+    long estimateMemory = this.treeWriter.estimateMemory();

Review comment:
       In iceberg, we usually don't use `this.` to access the private member 
because we expect to use `this` to distingush  the private member and local 
variable when assigning a given value to someone.




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

Reply via email to