0% found this document useful (0 votes)
20 views2 pages

ETL Pipeline Project with Airflow

Uploaded by

Aya Laadaili
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

ETL Pipeline Project with Airflow

Uploaded by

Aya Laadaili
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Project Overview

Instructions
Now that you are equipped with the knowledge and skills to extract, transform and load data you will use
these skills to perform ETL, create a pipeline and upload the data into a database. You will use BashOperator
with Airflow in the hands-on lab.

Scenario
You are a data engineer at a data analytics consulting company. You have been assigned a project to
decongest the national highways by analyzing the road traffic data from different toll plazas. Each highway is
operated by a different toll operator with a different IT setup that uses different file formats. Your job is to
collect data available in different formats and consolidate it into a single file.

In this assignment, you will develop an Apache Airflow DAG that will:

Extract data from a csv file


Extract data from a tsv file
Extract data from a fixed-width file
Transform the data
Load the transformed data into the staging area

Grading Criteria
There are a total of 25 points for 13 tasks in this final project spread in one hands-on lab.

Your final assignment will be graded by your peers who are also completing this assignment within the same
session. Your grade will be based on the following tasks:

Exercise 1: Create imports, DAG argument and definition


Task 1.1: Define DAG arguments (2pts)
Task 1.2: Define the DAG (2pts)
Exercise 2: Create the tasks using BashOperator
Task 2.1: Create a task to unzip data. (2pts)
Task 2.2: Create a task to extract data from csv file (2pts)
Task 2.3: Create a task to extract data from tsv file (2pts)
Task 2.4: Create a task to extract data from fixed width file (2pts)
Task 2.5: Create a task to consolidate data extracted from previous tasks (2pts)
Task 2.6: Transform the data (2 pts)
Task 2.7: Define the task pipeline (1pt)
Exercise 3: Getting the DAG operational
Task 3.1: Submit the DAG (1pt)
Task3.2: Unpause and trigger the DAG (3pt)
Task 3.3: List the DAG tasks (2 pt)
Task 3.4: Monitor the DAG (2pt)

How to submit
You will need to submit a screenshot in the JPEG or PNG format or all tasks. The screenshots will be uploaded
in the submission step of the final project. You will be prompted to save screenshots throughout the labs and
these will be the files you submit during the Project Submission and Peer Review section of this course.

Common questions

Powered by AI

The diversity in file formats among toll operators, such as CSV, TSV, and fixed-width files, requires the ETL process to include specific steps for each format during data extraction. This complexity necessitates custom extraction tasks depending on the file type to effectively handle and consolidate data into a unified format, ensuring smooth integration downstream in ETL pipelines .

Defining DAG arguments specifies the configurations and parameters for task execution, such as scheduling intervals and dependencies, within Apache Airflow. This setup is crucial for orchestrating tasks in an ETL pipeline, ensuring they are executed in the correct order and at the appropriate times, thereby contributing to the pipeline's successful execution .

When creating a task to extract data from fixed-width files, considerations include defining column boundaries based on character counts, handling potential data loss at format boundaries, and ensuring data integrity. The task should accurately parse and interpret the fixed-width data into the desired structured format for further processing .

BashOperator in Apache Airflow facilitates execution of bash scripts, enabling seamless scheduling and automation of diverse tasks within an ETL pipeline, such as unzipping files and extracting data in different formats. This allows for greater flexibility and control over task execution, enhancing the reliability and efficiency of the data processing workflow .

Data transformation is critical as it involves cleansing, structuring, and formatting the extracted data into a consistent format suitable for analysis. This step ensures data accuracy and quality by addressing inconsistencies and aligning with the schema of the target databases, thereby facilitating meaningful analysis of traffic data once loaded into the staging area .

Defining a task pipeline in Apache Airflow is crucial for establishing task dependencies and execution order, ensuring a smooth flow of data through the ETL process. This reduces the likelihood of errors and ensures data is processed, transformed, and loaded in a logical sequence, maintaining data integrity and consistency across the pipeline .

Consolidating data from different file formats poses challenges such as handling varying delimiters, data types, and schemas. Solutions involve creating specific extraction tasks tailored to each format, followed by a consolidation step where data is standardized into a single format. This process may also involve cleaning and aligning data attributes to ensure a seamless integration .

Monitoring in Apache Airflow entails tracking the DAG execution status, identifying failures, and analyzing performance metrics. This ensures prompt identification and resolution of issues, preventing data processing delays. Effective monitoring enhances pipeline performance by facilitating targeted interventions and optimizing task efficiency and resource allocation .

Using BashOperator to unzip data ensures files are prepared for subsequent data extraction tasks, effectively streamlining the extraction process. This reduces manual preprocessing time and minimizes errors, thereby speeding up the pipeline and improving overall data extraction efficiency in handling large volumes of traffic data .

Peer grading fosters collaborative learning and critical evaluation skills among participants. It encourages deeper engagement with the ETL project content through evaluating peers' work, stimulating reflection, and facilitating the mutual exchange of feedback, which enhances learning outcomes and skill development in data engineering tasks .

You might also like