Skip to content

Commit

Permalink
Fixed excessive memory usage when reading parquet (#5516)
Browse files Browse the repository at this point in the history
  • Loading branch information
malhotrashivam authored and devinrsmith committed May 23, 2024
1 parent 494ecf5 commit 3d80f7e
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ private void ensureInitialized(@Nullable final FillContext fillContext) {

if (numPages == 1) {
fixedPageSize = numRows();
return;
}
boolean isPageSizeFixed = true;
final long firstPageSize = offsetIndex.getFirstRowIndex(1) - offsetIndex.getFirstRowIndex(0);
for (int i = 2; i < numPages; ++i) {
if (offsetIndex.getFirstRowIndex(i) - offsetIndex.getFirstRowIndex(i - 1) != firstPageSize) {
isPageSizeFixed = false;
break;
} else {
boolean isPageSizeFixed = true;
final long firstPageSize = offsetIndex.getFirstRowIndex(1) - offsetIndex.getFirstRowIndex(0);
for (int i = 2; i < numPages; ++i) {
if (offsetIndex.getFirstRowIndex(i) - offsetIndex.getFirstRowIndex(i - 1) != firstPageSize) {
isPageSizeFixed = false;
break;
}
}
fixedPageSize = isPageSizeFixed ? firstPageSize : PAGE_SIZE_NOT_FIXED;
}
fixedPageSize = isPageSizeFixed ? firstPageSize : PAGE_SIZE_NOT_FIXED;
isInitialized = true;
}
}
Expand Down

0 comments on commit 3d80f7e

Please sign in to comment.