HPCC-10046 Optimize aggregate on single row datasets

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Merge pull request #4871 from ghalliday/issue10046

HPCC-10046 Optimize aggregate on single row datasets

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>