Fix Parquet Predicate Pushdown on Dictionaries
Commit refactored ParquetPredicateUtils.getDictionaries from
getDictionariesByColumnOrdinal, removing a nested loop iteration but
accidentally leaving in a break statement. The effect has been that
at most 1 dictionary was returned from getDictionaries, limiting the
effectiveness of predicate pushdown on dictionaries.
@@ -125,7 +125,6 @@ public final class PredicateUtils
dataSource.readFully(columnMetaData.getStartingPos(), buffer);
Optional<DictionaryPage> dictionaryPage = readDictionaryPage(buffer, columnMetaData.getCodec());
dictionaries.put(descriptor, new DictionaryDescriptor(descriptor, dictionaryPage));
- break;
}
}
}
@@ -157,7 +156,7 @@ public final class PredicateUtils
private static boolean isColumnPredicate(ColumnDescriptor columnDescriptor, TupleDomain<ColumnDescriptor> parquetTupleDomain)
{
verify(parquetTupleDomain.getDomains().isPresent(), "parquetTupleDomain is empty");
- return parquetTupleDomain.getDomains().get().keySet().contains(columnDescriptor);
+ return parquetTupleDomain.getDomains().get().containsKey(columnDescriptor);
}
@VisibleForTesting
