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/12 20:01:55 UTC

[GitHub] [iceberg] jshmchenxi commented on a change in pull request #2642: Core: Support writing parquet bloom filter

jshmchenxi commented on a change in pull request #2642:
URL: https://github.com/apache/iceberg/pull/2642#discussion_r667996047



##########
File path: parquet/src/main/java/org/apache/iceberg/parquet/ParquetUtil.java
##########
@@ -297,6 +297,10 @@ public static boolean hasNonDictionaryPages(ColumnChunkMetaData meta) {
     }
   }
 
+  public static boolean hasNonBloomFilterPages(ColumnChunkMetaData meta) {
+    return meta.getBloomFilterOffset() == -1;

Review comment:
       I did some search and didn't find another approach. `ColumnChunkMetaData#getBloomFilterOffset` is also used when reading bloom filter to judge if bloom filter is enabled, see [ParquetFileReader#readBloomFilter](https://github.com/apache/parquet-mr/blob/db75a6815f2ba1d1ee89d1a90aeb296f1f3a8f20/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java#L1182).

##########
File path: parquet/src/main/java/org/apache/iceberg/parquet/ParquetUtil.java
##########
@@ -297,6 +297,10 @@ public static boolean hasNonDictionaryPages(ColumnChunkMetaData meta) {
     }
   }
 
+  public static boolean hasNonBloomFilterPages(ColumnChunkMetaData meta) {
+    return meta.getBloomFilterOffset() == -1;

Review comment:
       I did some search and didn't find another approach. `ColumnChunkMetaData#getBloomFilterOffset` is also used when reading bloom filter to judge if bloom filter is enabled, see [ParquetFileReader#readBloomFilter](https://github.com/apache/parquet-mr/blob/db75a6815f2ba1d1ee89d1a90aeb296f1f3a8f20/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java#L1182).
   However, I should change `== -1` to `< 0`

##########
File path: parquet/src/main/java/org/apache/iceberg/parquet/ParquetWriter.java
##########
@@ -38,16 +38,17 @@
 import org.apache.parquet.bytes.ByteBufferAllocator;
 import org.apache.parquet.column.ColumnWriteStore;
 import org.apache.parquet.column.ParquetProperties;
-import org.apache.parquet.column.page.PageWriteStore;
+import org.apache.parquet.column.values.bloomfilter.BloomFilterWriteStore;
 import org.apache.parquet.hadoop.CodecFactory;
+import org.apache.parquet.hadoop.ColumnChunkPageWriteStore;
 import org.apache.parquet.hadoop.ParquetFileWriter;
 import org.apache.parquet.hadoop.metadata.CompressionCodecName;
 import org.apache.parquet.schema.MessageType;
 
 class ParquetWriter<T> implements FileAppender<T>, Closeable {
 
-  private static DynConstructors.Ctor<PageWriteStore> pageStoreCtorParquet = DynConstructors
-          .builder(PageWriteStore.class)
+  private static DynConstructors.Ctor<ColumnChunkPageWriteStore> pageStoreCtorParquet = DynConstructors
+          .builder(ColumnChunkPageWriteStore.class)

Review comment:
       Yes, `ColumnChunkPageWriteStore` used to be a package-private class and has to be created by reflection. I didn't pay much attension to the `InterfaceAudience.Private` annotation and thanks for pointing it out.




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