huaxingao commented on code in PR #4831:
URL: https://github.com/apache/iceberg/pull/4831#discussion_r878799752


##########
parquet/src/main/java/org/apache/iceberg/parquet/Parquet.java:
##########
@@ -239,6 +245,13 @@ public <D> FileAppender<D> build() throws IOException {
       CompressionCodecName codec = context.codec();
       int rowGroupCheckMinRecordCount = context.rowGroupCheckMinRecordCount();
       int rowGroupCheckMaxRecordCount = context.rowGroupCheckMaxRecordCount();
+      boolean bloomFilterEnabled = PropertyUtil.propertyAsBoolean(config, 
DEFAULT_PARQUET_BLOOM_FILTER_ENABLED,
+          DEFAULT_PARQUET_BLOOM_FILTER_ENABLED_DEFAULT);
+      int bloomFilterMaxBytes = PropertyUtil.propertyAsInt(config, 
PARQUET_BLOOM_FILTER_MAX_BYTES,
+          PARQUET_BLOOM_FILTER_MAX_BYTES_DEFAULT);
+      Map<String, String> columnBloomFilterModes = 
getBloomColumnConfigMap(PARQUET_BLOOM_FILTER_COLUMN_ENABLED_PREFIX);
+      Map<String, String> columnBloomFilterNDVs =
+          
getBloomColumnConfigMap(PARQUET_BLOOM_FILTER_COLUMN_EXPECTED_NDV_PREFIX);

Review Comment:
   It's cleaner to get it from the Context. Changed. Thanks



##########
parquet/src/main/java/org/apache/iceberg/parquet/Parquet.java:
##########
@@ -292,11 +320,39 @@ public <D> FileAppender<D> build() throws IOException {
             .withRowGroupSize(rowGroupSize)
             .withPageSize(pageSize)
             .withDictionaryPageSize(dictionaryPageSize)
-            .build(),
+            // TODO: add .withMaxBloomFilterBytes(bloomFilterMaxBytes) once 
ParquetWriter.Builder supports it
+            .withBloomFilterEnabled(bloomFilterEnabled);
+
+        for (Map.Entry<String, String> entry : 
columnBloomFilterModes.entrySet()) {
+          String col = entry.getKey();
+          String value = entry.getValue();

Review Comment:
   Changed



##########
parquet/src/main/java/org/apache/iceberg/parquet/Parquet.java:
##########
@@ -292,11 +320,39 @@ public <D> FileAppender<D> build() throws IOException {
             .withRowGroupSize(rowGroupSize)
             .withPageSize(pageSize)
             .withDictionaryPageSize(dictionaryPageSize)
-            .build(),
+            // TODO: add .withMaxBloomFilterBytes(bloomFilterMaxBytes) once 
ParquetWriter.Builder supports it
+            .withBloomFilterEnabled(bloomFilterEnabled);
+
+        for (Map.Entry<String, String> entry : 
columnBloomFilterModes.entrySet()) {
+          String col = entry.getKey();
+          String value = entry.getValue();
+          parquetWriteBuilder.withBloomFilterEnabled(col, 
Boolean.valueOf(value));
+        }
+
+        for (Map.Entry<String, String> entry : 
columnBloomFilterNDVs.entrySet()) {
+          String col = entry.getKey();
+          String value = entry.getValue();

Review Comment:
   Changed



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