uros7251brick opened a new pull request, #3412: URL: https://github.com/apache/parquet-java/pull/3412
<!-- Thanks for opening a pull request! If you're new to Parquet-Java, information on how to contribute can be found here: https://parquet.apache.org/docs/contribution-guidelines/contributing Please open a GitHub issue for this pull request: https://github.com/apache/parquet-java/issues/new/choose and format pull request title as below: GH-${GITHUB_ISSUE_ID}: ${SUMMARY} or simply use the title below if it is a minor issue: MINOR: ${SUMMARY} --> ### Rationale for this change Engines like Apache Spark need to know which row group a record belongs to — for example, to expose row group metadata as a hidden column, or to correlate records with row group-level statistics. Without this API, callers have no way to determine the current row group index during sequential reads. ### What changes are included in this PR? Similar to how `getCurrentRowIndex()` was introduced to expose the current row's file-level index, this adds `getCurrentRowGroupIndex()` to expose the index of the row group currently being read. New API: - `ParquetFileReader.getCurrentRowGroupIndex()` — returns the 0-based index of the last row group read via `readNextRowGroup() / readNextFilteredRowGroup()`. Returns -1 before any row group has been read. - `ParquetReader.getCurrentRowGroupIndex()` — same semantics, for the high-level record reader. - `ParquetRecordReader.getCurrentRowGroupIndex()` — same, for the Hadoop MapReduce record reader. The returned index is the actual file-level row group index, meaning it correctly reflects gaps when empty row groups are skipped (e.g. if row group 1 is empty, the indices reported will be 0, 2, ... not 0, 1, ...). ### Are these changes tested? Yes. ### Are there any user-facing changes? No. <!-- Please uncomment the line below and replace ${GITHUB_ISSUE_ID} with the actual Github issue id. --> Closes #3411 -- 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]
