Skip to content

Instantly share code, notes, and snippets.

@igorwwwwwwwwwwwwwwwwwwww
igorwwwwwwwwwwwwwwwwwwww / hadoop-streaming.rb
Created April 16, 2018 18:08 — forked from dsingley/hadoop-streaming.rb
Hadoop Streaming API for Ruby
def emit(key, value, sep="\t")
STDOUT.puts('' << key << sep << value)
end
def map(*options)
options = [:split, "\t", 2] if options.empty?
STDIN.each_line do |line|
line.strip!
key, value = line.send(*options)