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 2021/07/23 07:06:38 UTC

[GitHub] [iceberg] openinx commented on a change in pull request #2851: Core: Add delete table properties for Avro and Parquet

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



##########
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:
       Nit:  could we align this value parser with the following `deleteContext` by using `PropertyUtil.propertyAsInt` ? 




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