Github user kevinjmh commented on a diff in the pull request: https://github.com/apache/carbondata/pull/3000#discussion_r243130074 --- Diff: datamap/bloom/src/main/java/org/apache/hadoop/util/bloom/CarbonBloomFilter.java --- @@ -49,27 +49,23 @@ public CarbonBloomFilter(int vectorSize, int nbHash, int hashType, boolean compr @Override public boolean membershipTest(Key key) { - if (key == null) { - throw new NullPointerException("key cannot be null"); - } - - int[] h = hash.hash(key); - hash.clear(); if (compress) { // If it is compressed check in roaring bitmap + if (key == null) { --- End diff -- The reason I code it like this is for consistent procedure. And I don't think it can reduce call for GENERAL cases. Null is only one special case, and all the others are not-null cases. If change it as you advised, all non-null cases will have to do double null check when bloom filter is not compressed.
---