Giter Club home page Giter Club logo

datalakewithspark's Introduction

Data Lake with Spark

Overview

The schema for analyses Song play dataset from the start-up called Sparkify In this project, demonstrate of analytic data using Spark with Amazon EMR

Datasets

We will working with two dataset reside in S3 using the following links:

1.Song Play: s3a://udacity-dend/song_data/*/*/*/*.json 2.Log Data: s3a://udacity-dend/log_data/*/*/*/*.json

Song Play data

In this data, it is a subset of the real data from Million Song Dataset Each file is in JSON format and contains metadata about a song and the artist of that song.

Log Dataset

This dataset, is consist of log file in JSON format that generated by Event Simulator based on the song event from first dataset

For example log_data

UDF timestamp convert

In this project we need to convert timestamp into datetime. Due to the native convertion from native pyspark.

Process data function

In the data process, it has 2 database, song_data and log_data.

Step for Songs, Artists, User tables

  • Read data and save into dataframe variable using spark.read
  • Extract data into table
  • Overwrite data using 'write.mode'

Step for extracting timestamp

  • Get data from spark.read
  • Covert timestamp using datetime UDF function
  • Adding timestamp into table using '.withColumn'

Files

  1. dl.cfg = Configuration file
  2. etl.py = python file for runing ETL process
  3. README.md = Instruction and explanation for the project
  4. workingspace.ipynb = working space for testing code and checking in Python notebook

Running

  1. Open EMR cluster
  2. Add key and secret key to config file
  3. Running command '''python3 etl.py'''

datalakewithspark's People

Contributors

xenonar avatar

Watchers

 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.