Вопрос

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