Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
malhotrashivam committed Oct 8, 2024
1 parent d159a91 commit 54314b7
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,20 +195,12 @@ protected ColumnLocation makeColumnLocation(@NotNull final String columnName) {
private RowSet computeIndex() {
final RowSetBuilderSequential sequentialBuilder = RowSetFactory.builderSequential();

boolean foundEmptyRowGroup = false;
for (int rgi = 0; rgi < rowGroups.length; ++rgi) {
final long subRegionSize = rowGroups[rgi].getNum_rows();
if (subRegionSize < 0) {
throw new TableDataException("Negative row count " + subRegionSize + " in row group " + rgi);
}
if (subRegionSize == 0) {
foundEmptyRowGroup = true;
// Skip empty row groups
continue;
}
if (foundEmptyRowGroup) {
throw new TableDataException("Reading parquet files with empty row groups in the middle, found empty " +
"row group at index " + (rgi - 1) + " followed by non-empty row group at index " + rgi);
}
final long subRegionFirstKey = (long) rgi << regionParameters.regionMaskNumBits;
final long subRegionLastKey = subRegionFirstKey + subRegionSize - 1;
sequentialBuilder.appendRange(subRegionFirstKey, subRegionLastKey);
Expand Down

0 comments on commit 54314b7

Please sign in to comment.