Git Product home page Git Product logo

etl-recipes's Introduction

Technical Challenge for spark

Load some recipes from a file, select the recipes with chilies (singular, plural and with typo) and export them into a parquet file. This was a technical challenge to skill myself with Spark.

Set-up

  • Install python 2.7.14, like using pyenv: pyenv install 2.7.14
  • Install requirements, like with pip pip install -r requirements.txt
  • Install Spark 1.6.1
  • Add package pySpark
  • Ensure NLTK dependencies are up to date: python -c "import nltk;nltk.download()"
  • Download input dataset in the project folder, like with wget: wget https://s3-eu-west-1.amazonaws.com/dwh-test-resources/recipes.json .

Run me

Local mode

python spark.py local

In Standalone

  1. Start services
sbin/start-master.sh -h 127.0.0.1  # start spark master
sbin/start-slave.sh spark://127.0.0.1:7070 # add exeutor to master
  1. Launch application with spark-submit. For instance, on my local installation:
~/sys/spark-1.6.1-bin-hadoop2.4/bin/spark-submit spark.py spark://localhost:7077

Over YARN

~/sys/spark-1.6.1-bin-hadoop2.4/bin/spark-submit spark.py yarn-client

Test

On top of each commit, all tests must pass:

py.test && rm -r **/*.pyc **/__pycache__

Code quality

On top of each commit, no offense must be detected:

pep8 -- .

etl-recipes's People

Contributors

gobert avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

farman1855

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.