presto-main/src/main/java/io/prestosql/sql/planner/iterative/rule/ImplementFilteredAggregations.java/ImplementFilteredAggregations/hasFilters
class ImplementFilteredAggregations:    private static boolean hasFilters(AggregationNode aggregation)
    {
        return aggregation.getAggregations()
                .values().stream()
                .anyMatch(e -> e.getFilter().isPresent() &&
                        !e.getMask().isPresent()); // can't handle filtered aggregations with DISTINCT (conservatively, if they have a mask)
    }