rdblue commented on a change in pull request #1474:
URL: https://github.com/apache/iceberg/pull/1474#discussion_r490621065
##########
File path: parquet/src/main/java/org/apache/iceberg/parquet/ReadConf.java
##########
@@ -166,15 +167,19 @@ ParquetFileReader reader() {
}
private Map<Long, Long> generateOffsetToStartPos() {
- ParquetFileReader fileReader = newReader(this.file,
ParquetReadOptions.builder().build());
+
Map<Long, Long> offsetToStartPos = new HashMap<>();
- long curRowCount = 0;
- for (int i = 0; i < fileReader.getRowGroups().size(); i += 1) {
- BlockMetaData meta = fileReader.getRowGroups().get(i);
- offsetToStartPos.put(meta.getStartingPos(), curRowCount);
- curRowCount += meta.getRowCount();
- }
+ try(ParquetFileReader fileReader = newReader(this.file,
ParquetReadOptions.builder().build())) {
Review comment:
While you're changing this, can you remove `this.` from the variable
reference? We use `this.` to distinguish setting instance fields, not getting
instance fields.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]