class Spark::Command::KeyBy


KeyBy

Public Instance Methods

lazy_run(iterator, *) click to toggle source
# File lib/spark/command/basic.rb, line 267
def lazy_run(iterator, *)
  iterator.map do |item|
    [@key_function.call(item), item]
  end
end
run(iterator, *) click to toggle source
# File lib/spark/command/basic.rb, line 260
def run(iterator, *)
  iterator.map! do |item|
    [@key_function.call(item), item]
  end
  iterator
end