Source:
public Map<Integer, Filter> getFilters() { Optional<Map<C, Domain>> optionalEffectivePredicateDomains = effectivePredicate.getDomains(); if (!optionalEffectivePredicateDomains.isPresent()) { return ImmutableMap.of(); } Map<C, Domain> effectivePredicateDomains = optionalEffectivePredicateDomains.get(); Map<Integer, Filter> filters = new HashMap(); for (Map.Entry<C, Domain> entry : effectivePredicateDomains.entrySet()) { Domain predicateDomain = entry.getValue(); C column = entry.getKey(); if (!(column instanceof ColumnHandle)) { return null; } ColumnHandle columnHandle = (ColumnHandle) column; SubfieldPath subfield = columnHandle.getSubfieldPath(); ColumnHandle topLevelColumn = subfield == null ? columnHandle : columnHandle.createSubfieldColumnHandle(null); ColumnReference<C> columnReference = null; for (ColumnReference<C> c : columnReferences) { if (c.getColumn().equals(topLevelColumn)) { columnReference = c; break; } } if (columnReference == null) { return null; } ValueSet values = predicateDomain.getValues(); if (values instanceof SortedRangeSet) { List<Range> ranges = ((SortedRangeSet) values).getOrderedRanges(); Type type = predicateDomain.getType(); boolean nullAllowed = predicateDomain.isNullAllowed(); Filter filter; if (ranges.isEmpty() && nullAllowed) { filter = Filters.isNull(); } else if (ranges.size() == 1) { filter = createRangeFilter(type, ranges.get(0), nullAllowed); } else { List<Filter> rangeFilters = ranges.stream() .map(r -> createRangeFilter(type, r, false)) .filter(f -> f != Filters.alwaysFalse()) .collect(toList()); if (rangeFilters.isEmpty()) { filter = nullAllowed ? Filters.isNull() : Filters.alwaysFalse(); } else { filter = Filters.createMultiRange(rangeFilters, nullAllowed); } } if (filter == null) { return null; } addFilter(columnReference.getOrdinal(), subfield, filter, filters); } else { return null; } } return filters; }

Target:
public Map<Integer, Filter> getFilters() { Optional<Map<C, Domain>> optionalEffectivePredicateDomains = effectivePredicate.getDomains(); if (!optionalEffectivePredicateDomains.isPresent()) { return ImmutableMap.of(); } Map<C, Domain> effectivePredicateDomains = optionalEffectivePredicateDomains.get(); Map<Integer, Filter> filters = new HashMap(); for (Map.Entry<C, Domain> entry : effectivePredicateDomains.entrySet()) { Domain predicateDomain = entry.getValue(); C column = entry.getKey(); checkState(column instanceof ColumnHandle, "Unexpected column handle type: " + column.getClass().getSimpleName()); ColumnHandle columnHandle = (ColumnHandle) column; SubfieldPath subfield = columnHandle.getSubfieldPath(); ColumnHandle topLevelColumn = subfield == null ? columnHandle : columnHandle.createSubfieldColumnHandle(null); ColumnReference<C> columnReference = null; for (ColumnReference<C> c : columnReferences) { if (c.getColumn().equals(topLevelColumn)) { columnReference = c; break; } } checkState(columnReference != null, "Column not found: " + topLevelColumn); ValueSet values = predicateDomain.getValues(); if (!(values instanceof SortedRangeSet)) { throw new UnsupportedOperationException("Unexpected TupleDomain: " + values.getClass().getSimpleName()); } List<Range> ranges = ((SortedRangeSet) values).getOrderedRanges(); Type type = predicateDomain.getType(); boolean nullAllowed = predicateDomain.isNullAllowed(); Filter filter; if (ranges.isEmpty() && nullAllowed) { filter = Filters.isNull(); } else if (ranges.size() == 1) { filter = createRangeFilter(type, ranges.get(0), nullAllowed); } else { List<Filter> rangeFilters = ranges.stream() .map(r -> createRangeFilter(type, r, false)) .filter(f -> f != Filters.alwaysFalse()) .collect(toImmutableList()); if (rangeFilters.isEmpty()) { filter = nullAllowed ? Filters.isNull() : Filters.alwaysFalse(); } else { filter = Filters.createMultiRange(rangeFilters, nullAllowed); } } addFilter(columnReference.getOrdinal(), subfield, filter, filters); } return filters; }