prakharjain09 commented on a change in pull request #945:
URL: https://github.com/apache/parquet-mr/pull/945#discussion_r807496854
##########
File path:
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/InternalParquetRecordReader.java
##########
@@ -69,6 +71,8 @@
private long current = 0;
private int currentBlock = -1;
private ParquetFileReader reader;
+ private long currentRowIndex = -1L;
+ private PrimitiveIterator.OfLong rowIndexWithinFileIterator;
Review comment:
renamed to `rowIdxInFileItr`.
##########
File path:
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/InternalParquetRecordReader.java
##########
@@ -69,6 +71,8 @@
private long current = 0;
private int currentBlock = -1;
private ParquetFileReader reader;
+ private long currentRowIndex = -1L;
+ private PrimitiveIterator.OfLong rowIndexWithinFileIterator;
Review comment:
renamed to shorter name.
##########
File path:
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/InternalParquetRecordReader.java
##########
@@ -265,4 +273,51 @@ public boolean nextKeyValue() throws IOException,
InterruptedException {
return Collections.unmodifiableMap(setMultiMap);
}
+ /**
+ * Returns the ROW_INDEX of the current row.
+ */
+ public long getCurrentRowIndex() {
+ if (current == 0L) {
+ throw new RowIndexFetchedWithoutProcessingRowException("row index can be
fetched only after processing a row");
+ }
+ if (rowIndexWithinFileIterator == null) {
+ throw new RowIndexNotSupportedException("underlying page read store
implementation" +
+ " doesn't support row index generation");
+ }
+ return currentRowIndex;
+ }
+
+ /**
+ * Resets the row index iterator based on the current processed row group.
+ */
+ private void resetRowIndexIterator(PageReadStore pages) {
+ Optional<Long> rowIndexOffsetForCurrentRowGroup =
pages.getRowIndexOffset();
Review comment:
renamed to shorter name.
--
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]