def sort_all_aggregations
        @metadata.allAggregations.sort! {|a1, a2| a1.name <=> a2.name}
        @metadata.allAggregations.uniq! {|a| a.name}
      end
def sort_all_aggregations
        @metadata.allAggregations.sort! {|a1, a2| a1.name <=> a2.name}
        @metadata.allAggregations.uniq! {|a| a.name}
      end
TODO: Move it to utils