chenjunjiedada commented on a change in pull request #1254:
URL: https://github.com/apache/iceberg/pull/1254#discussion_r462713011
##########
File path: parquet/src/main/java/org/apache/iceberg/parquet/ReadConf.java
##########
@@ -157,6 +164,23 @@ ParquetFileReader reader() {
return shouldSkip;
}
+ private Map<Long, Long> generateRowGroupsStartRowPos() {
Review comment:
Done.
##########
File path: parquet/src/main/java/org/apache/iceberg/parquet/ReadConf.java
##########
@@ -157,6 +164,23 @@ ParquetFileReader reader() {
return shouldSkip;
}
+ private Map<Long, Long> generateRowGroupsStartRowPos() {
+ ParquetFileReader fileReader = newReader(this.file,
ParquetReadOptions.builder().build());
+ Map<Long, Long> offsetToStartRowPosMap = new HashMap<>();
+ long curRowCount = 0;
+ for (int i = 0; i < fileReader.getRowGroups().size(); i += 1) {
+ BlockMetaData meta = fileReader.getRowGroups().get(i);
+ offsetToStartRowPosMap.put(meta.getStartingPos(), curRowCount);
+ curRowCount += meta.getRowCount();
+ }
+
+ return offsetToStartRowPosMap;
+ }
+
+ long[] startRowPositions() {
+ return rowGroupsStartRowPos;
Review comment:
NP, Done.
##########
File path: parquet/src/main/java/org/apache/iceberg/parquet/ReadConf.java
##########
@@ -85,6 +87,9 @@
this.rowGroups = reader.getRowGroups();
this.shouldSkip = new boolean[rowGroups.size()];
+ Map<Long, Long> offsetToStartRowPosMap = generateRowGroupsStartRowPos();
Review comment:
OK, done.
##########
File path:
parquet/src/main/java/org/apache/iceberg/parquet/BaseColumnIterator.java
##########
@@ -34,6 +34,7 @@
protected long triplesRead = 0L;
protected long advanceNextPageCount = 0L;
protected Dictionary dictionary;
+ protected long rowPosition;
Review comment:
Right, this and `setRowPosition` are no longer needed.
----------------------------------------------------------------
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]