Question

I am trying to write a EMR mapper in ruby, however I am unclear what parameter the file from the S3 bucket would be passed in as. My current code just uses:

require 'optparse'

options = {}
opts.parse(ARGV)
...
inputFile = options[:input]
mode = options[:mode]
downloadPrefix = options[:prefix]

However, this job fails when I try to create a test workflow through the aws console. So my question is, how does EMR pass the input parameter to the mapper script for ruby?

Was it helpful?

Solution

It uses STDIN, so:

STDIN.each_line do |line|
   puts line
end
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top