added test for aggregating functions' cache