Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ public <T extends Comparable<T>> Boolean visit(Eq<T> eq) {

filterColumn.getColumnPath();

if (value == null) {
// the dictionary contains only non-null values so isn't helpful. this
// could check the column stats, but the StatisticsFilter is responsible
return BLOCK_MIGHT_MATCH;
}

try {
Set<T> dictSet = expandDictionary(meta);
if (dictSet != null && !dictSet.contains(value)) {
Expand Down Expand Up @@ -150,6 +156,12 @@ public <T extends Comparable<T>> Boolean visit(NotEq<T> notEq) {

filterColumn.getColumnPath();

if (value == null) {
// the dictionary contains only non-null values so isn't helpful. this
// could check the column stats, but the StatisticsFilter is responsible
return BLOCK_MIGHT_MATCH;
}

try {
Set<T> dictSet = expandDictionary(meta);
if (dictSet != null && dictSet.size() == 1 && dictSet.contains(value)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ public void testEqBinary() throws Exception {

assertTrue("Should drop block for upper case letters",
canDrop(eq(b, Binary.fromString("A")), ccmd, dictionaries));

assertFalse("Should not drop block for null",
canDrop(eq(b, null), ccmd, dictionaries));
}

@Test
Expand All @@ -211,6 +214,9 @@ public void testNotEqBinary() throws Exception {

assertFalse("Should not drop block with a known value",
canDrop(notEq(b, Binary.fromString("B")), ccmd, dictionaries));

assertFalse("Should not drop block for null",
canDrop(notEq(b, null), ccmd, dictionaries));
}

@Test
Expand Down