سؤال

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?

هل كانت مفيدة؟

المحلول

It uses STDIN, so:

STDIN.each_line do |line|
   puts line
end
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top