aokolnychyi commented on a change in pull request #2851:
URL: https://github.com/apache/iceberg/pull/2851#discussion_r675725474



##########
File path: parquet/src/main/java/org/apache/iceberg/parquet/Parquet.java
##########
@@ -280,6 +283,90 @@ WriteBuilder withWriterVersion(WriterVersion version) {
             metricsConfig);
       }
     }
+
+    private static class Context {
+      private final int rowGroupSize;
+      private final int pageSize;
+      private final int dictionaryPageSize;
+      private final CompressionCodecName codec;
+      private final String compressionLevel;
+
+      private Context(int rowGroupSize, int pageSize, int dictionaryPageSize,
+                      CompressionCodecName codec, String compressionLevel) {
+        this.rowGroupSize = rowGroupSize;
+        this.pageSize = pageSize;
+        this.dictionaryPageSize = dictionaryPageSize;
+        this.codec = codec;
+        this.compressionLevel = compressionLevel;
+      }
+
+      public 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 pageSize = Integer.parseInt(config.getOrDefault(
+            PARQUET_PAGE_SIZE_BYTES, PARQUET_PAGE_SIZE_BYTES_DEFAULT));
+
+        int dictionaryPageSize = Integer.parseInt(config.getOrDefault(
+            PARQUET_DICT_SIZE_BYTES, PARQUET_DICT_SIZE_BYTES_DEFAULT));

Review comment:
       This is what I wanted to use too. Unfortunately, 
`PARQUET_ROW_GROUP_SIZE_BYTES_DEFAULT` is actually a String. That's why it is 
not possible to use `PropertyUtil`. Copied this code as it was in the original 
implementation.




-- 
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]

Reply via email to