Make the reduce function optional in GroupBy filter to allow grouping by column value