use of org.apache.parquet.format.XxHash in project parquet-mr by apache.
the class ParquetMetadataConverter method toBloomFilterHeader.
public static BloomFilterHeader toBloomFilterHeader(org.apache.parquet.column.values.bloomfilter.BloomFilter bloomFilter) {
BloomFilterAlgorithm algorithm = null;
BloomFilterHash hashStrategy = null;
BloomFilterCompression compression = null;
if (bloomFilter.getAlgorithm() == BloomFilter.Algorithm.BLOCK) {
algorithm = BloomFilterAlgorithm.BLOCK(new SplitBlockAlgorithm());
}
if (bloomFilter.getHashStrategy() == BloomFilter.HashStrategy.XXH64) {
hashStrategy = BloomFilterHash.XXHASH(new XxHash());
}
if (bloomFilter.getCompression() == BloomFilter.Compression.UNCOMPRESSED) {
compression = BloomFilterCompression.UNCOMPRESSED(new Uncompressed());
}
if (algorithm != null && hashStrategy != null && compression != null) {
return new BloomFilterHeader(bloomFilter.getBitsetSize(), algorithm, hashStrategy, compression);
} else {
throw new IllegalArgumentException(String.format("Failed to build thrift structure for BloomFilterHeader," + "algorithm=%s, hash=%s, compression=%s", bloomFilter.getAlgorithm(), bloomFilter.getHashStrategy(), bloomFilter.getCompression()));
}
}
Aggregations