GithubHelp home page GithubHelp logo

savadev / spark-movies-etl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guidok91/spark-movies-etl

0.0 0.0 0.0 2.41 MB

Spark data pipeline that ingests and transforms movie ratings data.

Python 89.10% Makefile 10.90%

spark-movies-etl's Introduction

Movies data ETL (Spark)

workflow Code style: black

Spark data pipeline that ingests and transforms movie ratings data.

Data Architecture

We define a Data Lakehouse architecture with the following layers:

  • Raw: Contains raw data files directly ingested from an event stream, e.g. Kafka. Data is not catalogued and should generally not be accessible (can contain PII).
  • Standardized: Contains standardized data (catalogued tables) based on the raw data but without any transformations applied (besides masking of PII data if necessary).
  • Curated: Contains transformed data (catalogued tables) according to business and data quality rules.

Apache Iceberg is used as the table format.

data architecture

Data pipeline design

The data pipeline consists of the following tasks:

  • Standardize task: ingests the dataset from the Raw layer into the Standardized one.
  • Curate task: consumes the dataset from Standardized, performs transformations and business logic, and persists into Curated.

The datasets are partitioned by execution date.

Execution instructions

The repo includes a Makefile. Please run make help to see usage.

Configuration management

Configuration is managed by the ConfigManager class, which is a wrapper around Dynaconf.

Packaging and dependency management

Poetry is used for Python packaging and dependency management.

CI/CD

Github Actions workflows for CI/CD are defined here and can be seen here.

The logic is as follows:

  • On PR creation/update:
    • Run code checks and tests.
    • Build app (*).
    • Release to S3 (to a specific location for the PR, e.g. s3://movies-binaries/movies-etl/PR-123).
  • On push to master:
    • Run code checks and tests.
    • Build app (*).
    • Release to S3 (to the location for the master version, e.g. s3://movies-binaries/movies-etl/latest).
    • Create Github release.

(*) The app build contains:

  • The Python entrypoint file.
  • A zip containing all the dependencies (Python packages).
  • The app_config.yaml file.

Orchestration

An example Airflow DAG to run this pipeline on a schedule can be found here.

spark-movies-etl's People

Contributors

guidok91 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.