aokolnychyi commented on code in PR #7267:
URL: https://github.com/apache/iceberg/pull/7267#discussion_r1157681621
##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetUtil.java:
##########
@@ -222,6 +222,24 @@ 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();
+ List<Long> splitOffsets =
Lists.newArrayListWithExpectedSize(md.getBlocks().size());
+ for (BlockMetaData blockMetaData : md.getBlocks()) {
+ splitOffsets.add(blockMetaData.getStartingPos());
Review Comment:
Shall we just call the overloaded method once we have `ParquetMetadata`?
```
return getSplitOffsets(reader.getFooter());
```
--
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]