def column_sum(pcollection, columns):
    """
    对输入的PCollection，求所有元素按指定列相加的结果

    Args:
      pcollection (PCollection):  输入PCollection
      columns(list)：要计算的列

    Returns:
      PObject:  聚合结果

    >>> import columns
    >>> _p = _pipeline.parallelize([(1, 1, 1), (1, 2, 2), (1, 3, 1)])
    >>> columns.column_sum(_p, [0, 1]).get()
    [3, 6]
    """

    cols = columns

    def _get_columns(record):
        return [record[column] for column in cols]

    return pcollection.map(_get_columns) \
                      .reduce(lambda x, y: [a + b for a, b in zip(x, y)])