You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "singhpk234 (via GitHub)" <gi...@apache.org> on 2023/04/19 00:33:16 UTC

[GitHub] [iceberg] singhpk234 commented on a diff in pull request #7267: API: Add ParquetUtils.getSplitOffsets that takes an InputFile

singhpk234 commented on code in PR #7267:
URL: https://github.com/apache/iceberg/pull/7267#discussion_r1170689053


##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetUtil.java:
##########
@@ -222,6 +222,19 @@ private static MessageType getParquetTypeWithIds(
     return ParquetSchemaUtil.addFallbackIds(type);
   }
 
+  /**
+   * Returns a list of offsets in ascending order determined by the starting position of the row
+   * groups.
+   */
+  public static List<Long> getSplitOffsets(InputFile file) {
+    try (ParquetFileReader reader = ParquetFileReader.open(ParquetIO.file(file))) {
+      ParquetMetadata md = reader.getFooter();
+      return getSplitOffsets(md);
+    } catch (IOException e) {
+      throw new RuntimeIOException(e, "Failed to read footer of file: %s", file);

Review Comment:
   [minor] should we throw `java.io.UncheckedIOException` instead considering we have marked RuntimeIOException as deprecated ? 



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