@Override public boolean matches(long numberOfRows, Map<Integer, ColumnStatistics> statisticsByColumnIndex) { Optional<Map<C, Domain>> optionalEffectivePredicateDomains = effectivePredicate.getDomains(); if (!optionalEffectivePredicateDomains.isPresent()) { // effective predicate is none, so skip this section return false; } Map<C, Domain> effectivePredicateDomains = optionalEffectivePredicateDomains.get(); for (ColumnReference<C> columnReference : columnReferences) { Domain predicateDomain = effectivePredicateDomains.get(columnReference.getColumn()); if (predicateDomain == null) { // no predicate on this column, so we can't exclude this section continue; } ColumnStatistics columnStatistics = statisticsByColumnIndex.get(columnReference.getOrdinal()); if (columnStatistics == null) { // no statistics for this column, so we can't exclude this section continue; } if (!columnOverlaps(columnReference, predicateDomain, numberOfRows, columnStatistics)) { return false; } } // this section was not excluded return true; }
@Override public boolean matches(long numberOfRows, Map<Integer, ColumnStatistics> statisticsByColumnIndex) { Optional<Map<C, Domain>> optionalEffectivePredicateDomains = effectivePredicate.getDomains(); if (!optionalEffectivePredicateDomains.isPresent()) { // effective predicate is none, so skip this section return false; } Map<C, Domain> effectivePredicateDomains = optionalEffectivePredicateDomains.get(); for (ColumnReference<C> columnReference : columnReferences) { Domain predicateDomain = effectivePredicateDomains.get(columnReference.getColumn()); if (predicateDomain == null) { // no predicate on this column, so we can't exclude this section continue; } ColumnStatistics columnStatistics = statisticsByColumnIndex.get(columnReference.getOrdinal()); if (columnStatistics == null) { // no statistics for this column, so we can't exclude this section continue; } if (!columnOverlaps(columnReference, predicateDomain, numberOfRows, columnStatistics)) { return false; } } // this section was not excluded return true; }