@@ -57,6 +57,7 @@ public class ParquetProperties {
5757 public static final int DEFAULT_PAGE_VALUE_COUNT_THRESHOLD = Integer .MAX_VALUE / 2 ;
5858 public static final int DEFAULT_COLUMN_INDEX_TRUNCATE_LENGTH = 64 ;
5959 public static final int DEFAULT_STATISTICS_TRUNCATE_LENGTH = Integer .MAX_VALUE ;
60+ public static final int DEFAULT_ROW_GROUP_ROW_COUNT_LIMIT = Integer .MAX_VALUE ;
6061 public static final int DEFAULT_PAGE_ROW_COUNT_LIMIT = 20_000 ;
6162 public static final int DEFAULT_MAX_BLOOM_FILTER_BYTES = 1024 * 1024 ;
6263 public static final boolean DEFAULT_BLOOM_FILTER_ENABLED = false ;
@@ -122,6 +123,7 @@ public static WriterVersion fromString(String name) {
122123 private final ColumnProperty <Boolean > bloomFilterEnabled ;
123124 private final ColumnProperty <Boolean > adaptiveBloomFilterEnabled ;
124125 private final ColumnProperty <Integer > numBloomFilterCandidates ;
126+ private final int rowGroupRowCountLimit ;
125127 private final int pageRowCountLimit ;
126128 private final boolean pageWriteChecksumEnabled ;
127129 private final ColumnProperty <ByteStreamSplitMode > byteStreamSplitEnabled ;
@@ -153,6 +155,7 @@ private ParquetProperties(Builder builder) {
153155 this .maxBloomFilterBytes = builder .maxBloomFilterBytes ;
154156 this .adaptiveBloomFilterEnabled = builder .adaptiveBloomFilterEnabled .build ();
155157 this .numBloomFilterCandidates = builder .numBloomFilterCandidates .build ();
158+ this .rowGroupRowCountLimit = builder .rowGroupRowCountLimit ;
156159 this .pageRowCountLimit = builder .pageRowCountLimit ;
157160 this .pageWriteChecksumEnabled = builder .pageWriteChecksumEnabled ;
158161 this .byteStreamSplitEnabled = builder .byteStreamSplitEnabled .build ();
@@ -302,6 +305,10 @@ public boolean estimateNextSizeCheck() {
302305 return estimateNextSizeCheck ;
303306 }
304307
308+ public int getRowGroupRowCountLimit () {
309+ return rowGroupRowCountLimit ;
310+ }
311+
305312 public int getPageRowCountLimit () {
306313 return pageRowCountLimit ;
307314 }
@@ -400,6 +407,7 @@ public static class Builder {
400407 private final ColumnProperty .Builder <Boolean > adaptiveBloomFilterEnabled ;
401408 private final ColumnProperty .Builder <Integer > numBloomFilterCandidates ;
402409 private final ColumnProperty .Builder <Boolean > bloomFilterEnabled ;
410+ private int rowGroupRowCountLimit = DEFAULT_ROW_GROUP_ROW_COUNT_LIMIT ;
403411 private int pageRowCountLimit = DEFAULT_PAGE_ROW_COUNT_LIMIT ;
404412 private boolean pageWriteChecksumEnabled = DEFAULT_PAGE_WRITE_CHECKSUM_ENABLED ;
405413 private final ColumnProperty .Builder <ByteStreamSplitMode > byteStreamSplitEnabled ;
@@ -679,6 +687,12 @@ public Builder withBloomFilterEnabled(String columnPath, boolean enabled) {
679687 return this ;
680688 }
681689
690+ public Builder withRowGroupRowCountLimit (int rowCount ) {
691+ Preconditions .checkArgument (rowCount > 0 , "Invalid row count limit for row groups: %s" , rowCount );
692+ rowGroupRowCountLimit = rowCount ;
693+ return this ;
694+ }
695+
682696 public Builder withPageRowCountLimit (int rowCount ) {
683697 Preconditions .checkArgument (rowCount > 0 , "Invalid row count limit for pages: %s" , rowCount );
684698 pageRowCountLimit = rowCount ;
0 commit comments