You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/02/06 20:36:03 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #3181: Parquet: make row group check (min and max record count) configurable.

rdblue commented on a change in pull request #3181:
URL: https://github.com/apache/iceberg/pull/3181#discussion_r800229896



##########
File path: parquet/src/main/java/org/apache/iceberg/parquet/Parquet.java
##########
@@ -291,32 +301,56 @@ private WriteBuilder createContextFunc(Function<Map<String, String>, Context> ne
       private final int dictionaryPageSize;
       private final CompressionCodecName codec;
       private final String compressionLevel;
+      private final int rowGroupCheckMinRecordCount;
+      private final int rowGroupCheckMaxRecordCount;
 
       private Context(int rowGroupSize, int pageSize, int dictionaryPageSize,
-                      CompressionCodecName codec, String compressionLevel) {
+                      CompressionCodecName codec, String compressionLevel,
+                      int rowGroupCheckMinRecordCount, int rowGroupCheckMaxRecordCount) {
         this.rowGroupSize = rowGroupSize;
         this.pageSize = pageSize;
         this.dictionaryPageSize = dictionaryPageSize;
         this.codec = codec;
         this.compressionLevel = compressionLevel;
+        this.rowGroupCheckMinRecordCount = rowGroupCheckMinRecordCount;
+        this.rowGroupCheckMaxRecordCount = rowGroupCheckMaxRecordCount;
       }
 
       static Context dataContext(Map<String, String> config) {
-        int rowGroupSize = Integer.parseInt(config.getOrDefault(
-            PARQUET_ROW_GROUP_SIZE_BYTES, PARQUET_ROW_GROUP_SIZE_BYTES_DEFAULT));
+        int rowGroupSize = PropertyUtil.propertyAsInt(config,
+            PARQUET_ROW_GROUP_SIZE_BYTES, PARQUET_ROW_GROUP_SIZE_BYTES_DEFAULT);
+        Preconditions.checkArgument(rowGroupSize > 0,
+            "Row group size must be > 0");

Review comment:
       Does this need to be on a separate line?




-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org