1

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?

4

1 に答える 1

1

STDIN を使用するため、次のようになります。

STDIN.each_line do |line|
   puts line
end
于 2013-10-08T18:17:13.293 に答える