def _reduce(klass, seq_op, comb_op, zero_value=nil)
        if seq_op.nil?
          # Partitions are already reduced
          rdd = self
        else
          rdd = new_rdd_from_command(klass, seq_op, zero_value)
        end

        # Send all results to one worker and combine results
        rdd = rdd.coalesce(1).compact

        # Add the same function to new RDD
        comm = rdd.add_command(klass, comb_op, zero_value)
        comm.deserializer = @command.serializer

        # Value is returned in array
        PipelinedRDD.new(rdd, comm).collect[0]
      end
def _reduce(klass, seq_op, comb_op, zero_value=nil)
        if seq_op.nil?
          # Partitions are already reduced
          rdd = self
        else
          rdd = new_rdd_from_command(klass, seq_op, zero_value)
        end

        # Send all results to one worker and combine results
        rdd = rdd.coalesce(1).compact

        # Add the same function to new RDD
        comm = rdd.add_command(klass, comb_op, zero_value)
        comm.deserializer = @command.serializer

        # Value is returned in array
        PipelinedRDD.new(rdd, comm).collect[0]
      end
This is base method for reduce operation. Is used by reduce, fold and aggregation.
 Only difference is that fold has zero value.