Eng 6695 partial agg for ordered subquery

This function should have some specific junit tests on plans with subqueries and with the subquery option enabled and disabled.