fitzscott / AirQuality

Air Quality study Utah
2 stars 0 forks source link

Passing parameters to Python running MR #5

Closed fitzscott closed 10 years ago

fitzscott commented 10 years ago

I'd like to pass in the field delimiter for the fields in the value for the data type MR job in Python. It looks like there's an option called cmdenv - see http://www.litfuel.net/plush/?postid=195. I've also been trying to get to http://wiki.apache.org/hadoop/HadoopStreaming, but it's returning a 503 / Service Unavailable.

fitzscott commented 10 years ago

-cmdenv =

e.g. -cmdenv EXAMPLE_DIR=/home/example/dictionaries/

fitzscott commented 10 years ago

-cmdenv varname=value

fitzscott commented 10 years ago

Inside Python (courtesy Stack Overflow)

print os.getenv('KEY_THAT_MIGHT_EXIST', default_value)

fitzscott commented 10 years ago

Yup, worked great. Delimiters now passed in to Python scripts.