You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/01/19 03:30:55 UTC

[GitHub] [iceberg] hililiwei commented on a change in pull request #3784: ORC:ORC supports rolling writers.

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



##########
File path: orc/src/main/java/org/apache/iceberg/orc/OrcFileAppender.java
##########
@@ -99,9 +104,34 @@ 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) {
+      if (batch.size > 0) {
+        try {
+          writer.addRowBatch(batch);
+          batch.reset();

Review comment:
       Removed this, but if didn't flush here, I was a little concerned that it will deviate a little from the actual size, although it may not be small.




-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org