Initial version of the reverse_nested agg