Search in sources :

Example 1 with Uncompressed

use of org.apache.parquet.format.Uncompressed 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()));
    }
}
Also used : SplitBlockAlgorithm(org.apache.parquet.format.SplitBlockAlgorithm) Uncompressed(org.apache.parquet.format.Uncompressed) BloomFilterAlgorithm(org.apache.parquet.format.BloomFilterAlgorithm) BloomFilterCompression(org.apache.parquet.format.BloomFilterCompression) XxHash(org.apache.parquet.format.XxHash) BloomFilterHeader(org.apache.parquet.format.BloomFilterHeader) BloomFilterHash(org.apache.parquet.format.BloomFilterHash)

Aggregations

BloomFilterAlgorithm (org.apache.parquet.format.BloomFilterAlgorithm)1 BloomFilterCompression (org.apache.parquet.format.BloomFilterCompression)1 BloomFilterHash (org.apache.parquet.format.BloomFilterHash)1 BloomFilterHeader (org.apache.parquet.format.BloomFilterHeader)1 SplitBlockAlgorithm (org.apache.parquet.format.SplitBlockAlgorithm)1 Uncompressed (org.apache.parquet.format.Uncompressed)1 XxHash (org.apache.parquet.format.XxHash)1