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/09/26 21:17:29 UTC

[GitHub] [iceberg] rdblue commented on a diff in pull request #5778: Orc: Closes #5777 - Obtain ORC stripe offsets from writer

rdblue commented on code in PR #5778:
URL: https://github.com/apache/iceberg/pull/5778#discussion_r980512390


##########
orc/src/main/java/org/apache/iceberg/orc/OrcFileAppender.java:
##########
@@ -147,11 +146,12 @@ public long length() {
   @Override
   public List<Long> splitOffsets() {
     Preconditions.checkState(isClosed, "File is not yet closed");
-    try (Reader reader = ORC.newFileReader(file.toInputFile(), conf)) {
-      List<StripeInformation> stripes = reader.getStripes();
+    try {
+      List<StripeInformation> stripes = writer.getStripes();
       return Collections.unmodifiableList(Lists.transform(stripes, StripeInformation::getOffset));
     } catch (IOException e) {
-      throw new RuntimeIOException(e, "Can't close ORC reader %s", file.location());
+      throw new RuntimeIOException(
+          e, "Cannot receive stripe information from writer for %s", file.location());

Review Comment:
   "Cannot receive" seems like a strange way to state that `getStripes` failed. What about `Failed to get stripe information from writer for: %s`?



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