def combine_by_key(create_combiner, merge_value, merge_combiners, num_partitions=nil)
      _combine_by_key(
        [Spark::Command::CombineByKey::Combine, create_combiner, merge_value],
        [Spark::Command::CombineByKey::Merge, merge_combiners],
        num_partitions
      )
    end
def combine_by_key(create_combiner, merge_value, merge_combiners, num_partitions=nil)
      _combine_by_key(
        [Spark::Command::CombineByKey::Combine, create_combiner, merge_value],
        [Spark::Command::CombineByKey::Merge, merge_combiners],
        num_partitions
      )
    end
Generic function to combine the elements for each key using a custom set of aggregation
 functions. Turns a JavaPairRDD[(K, V)] into a result of type JavaPairRDD[(K, C)], for a
 "combined type" C * Note that V and C can be different -- for example, one might group an
 RDD of type (Int, Int) into an RDD of type (Int, List[Int]). Users provide three
 functions:

 == Parameters:
 create_combiner:: which turns a V into a C (e.g., creates a one-element list)
 merge_value:: to merge a V into a C (e.g., adds it to the end of a list)
 merge_combiners:: to combine two C's into a single one.

 == Example:
   def combiner(x)
     x
   end

   def merge(x,y)
     x+y
   end

   rdd = $sc.parallelize(["a","b","c","a","b","c","a","c"], 2).map(lambda{|x| [x, 1]})
   rdd.combine_by_key(method(:combiner), method(:merge), method(:merge)).collect_as_hash
   # => {"a"=>3, "b"=>2, "c"=>3}