'The SortedDict of aggregate columns that are not masked, and should
be used in the SELECT clause.
This result is cached for optimization purposes.'

def _aggregate_select(self):

    if (self._aggregate_select_cache is not None):
        return self._aggregate_select_cache
    elif (self.aggregate_select_mask is not None):
        self._aggregate_select_cache = SortedDict([(k, v) for (k, v) in self.aggregates.items() if (k in self.aggregate_select_mask)])
        return self._aggregate_select_cache
    else:
        return self.aggregates
