The collector package reduces the mapped rows of the result set into a Stream Collector to produce the final aggregated result.