require_relative("group") module Wukong class Processor # Concatenates the elements of a group, yielding the group key, # the count, and its members. # # @example Concatenating elements of a group on the command-line. # # $ cat input # {"id": 1, "parent_id": 4} # {"id": 2, "parent_id": 3} # {"id": 3, "parent_id": 3} # ... # $ cat input | wu-local group_concat --by=parent_id --to=tsv # 4 1 {"id": 1, "parent_id": 4} # 3 2 {"id": 2, "parent_id": 3} {"id": 3, "parent_id": 3} # ... # # GroupConcat takes all the same options as Group. # # @see Group class GroupConcat < Group description <] the members of the group def finalize group = [key, size] group.concat(members) yield group end register end end end