public static byte[] getInitialBytes(long expectedEntries) {
    ByteArrayOutputStream bytesOut = null;
    try {
      bytesOut = new ByteArrayOutputStream();
      BloomKFilter bf = BloomKFilter.build(expectedEntries);
      BloomKFilter.serialize(bytesOut, bf);
      return bytesOut.toByteArray();
    } catch (Exception err) {
      throw new IllegalArgumentException("Error creating aggregation buffer", err);
    } finally {
      IOUtils.closeStream(bytesOut);
    }
  }
Merges BloomKFilter bf2 into bf1.
Assumes 2 BloomKFilters with the same size/hash functions are serialized to byte arrays

@param bf1Bytes Data of bloom filter 1.
@param bf1Start Start index of BF1.
@param bf1Length BF1 length.
@param bf2Bytes Data of bloom filter 1
@param bf2Start Start index of BF2.
@param bf2Length BF2 length.
storage-api/src/java/org/apache/hive/common/util/BloomKFilter.java