Code Monkey home page Code Monkey logo

emr-mailer's Introduction

Send a hive report via email.

This script will download files from an s3 url, concatenate them together, zip up the results and send it as an attachment to a specified email address.

This script assumes that you are using gmail (can be a custom google accounts domain) to send mail. You should modify FROM_EMAIL and FROM_PASSWORD above with the proper credentials.

This script does not currently handle:

  1. multiple email addresses (you probably want a mailing list anyway)
  2. multiple reports per email (just run the script multiple times)
  3. nested directories (don't partition your report)
  4. compressed files (don't think we're using this anyway for reports)

The intended usage is to run this as a job step with your hive script, passing it in the location of the report results in s3.

E.g. (you will need to change paths and arguments to match your setup)

elastic-mapreduce --create --name "my awesome report ${MONTH}" \

--num-instances 10 --instance-type c1.medium --hadoop-version 0.20 \

--hive-script --arg s3://path/to/hive/script.sql \

--args -d,MONTH=${MONTH} --args -d,START=${START} --args -d,END=${END} \

--jar s3://us-east-1.elasticmapreduce/libs/script-runner/script-runner.jar \

--args s3://path/to/emr-mailer/send-report.rb \

--args -n,report_${MONTH} --args -s,"my awesome report ${MONTH}" \

--args -e,[email protected] \

--args -r,s3://path/to/report/results

emr-mailer's People

Contributors

ogrodnek avatar

Watchers

James Cloos avatar john avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.