<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Naum Mukiti on Medium]]></title>
        <description><![CDATA[Stories by Naum Mukiti on Medium]]></description>
        <link>https://medium.com/@N_Mukiti?source=rss-47348e661411------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*77AzChQinHZvJRAq</url>
            <title>Stories by Naum Mukiti on Medium</title>
            <link>https://medium.com/@N_Mukiti?source=rss-47348e661411------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 06:00:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@N_Mukiti/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Dynamic Ingestion of NYC Taxi Data Using Azure Data Factory]]></title>
            <link>https://medium.com/@N_Mukiti/dynamic-ingestion-of-nyc-taxi-data-using-azure-data-factory-d86aeca1cc3b?source=rss-47348e661411------2</link>
            <guid isPermaLink="false">https://medium.com/p/d86aeca1cc3b</guid>
            <dc:creator><![CDATA[Naum Mukiti]]></dc:creator>
            <pubDate>Thu, 31 Jul 2025 23:27:56 GMT</pubDate>
            <atom:updated>2025-07-31T23:29:05.321Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Jjbg3xfgMNOiyKPX" /></figure><h3>Introduction</h3><p>Ever needed a seamless way to ingest structured public datasets into your cloud infrastructure — dynamically and reliably? In this project, I built a data pipeline using Azure Data Factory to automate the monthly ingestion of NYC Taxi trip data into Azure Data Lake, using the efficient Parquet format. What seemed like a straightforward ETL task quickly revealed layers of nuanced logic and optimization challenges.</p><p>This blog walks you through the step-by-step implementation of a dynamic pipeline that ingests all monthly data — from January to December — with a single, reusable loop. Let’s dive in.</p><h3>Problem Statement</h3><p>While the NYC Taxi dataset is publicly available in parquet format for each month and year, manually downloading, transforming, and storing these files is inefficient, especially when the data is updated regularly. I needed a solution that would:</p><ul><li>Dynamically fetch monthly files</li><li>Transform them into an optimized Parquet format</li><li>Handle variable month formatting (01 vs 1)</li><li>Require minimal manual updates</li></ul><h3>Tools Used</h3><ul><li><strong>Azure Data Factory</strong> (ADF): Data orchestration and transformation</li><li><strong>Azure Data Lake Storage Gen2</strong>: Scalable cloud storage</li><li><strong>NYC TLC Taxi Dataset</strong>: Public data source (<a href="https://www.nyc.gov/site/tlc/about/tlc-trip-record-data.page">link</a>)</li><li><strong>Parquet Format</strong>: For optimized columnar storage</li></ul><h3>Implementation Steps</h3><h4>Parameterize the Dataset</h4><p>To enable dynamic file resolution, I defined a parameter p_month in the source dataset. This parameter represents the month number dynamically injected into the dataset path.</p><p>trip-data/green_tripdata_2023-@{dataset().p_month}.parquet</p><p>This allowed ADF to substitute the month at runtime based on the loop logic.</p><h4>Set Up a ForEach Loop</h4><p>Next, I configured a <strong>ForEach activity</strong> to loop through all 12 months using the expression: @range(1,12).</p><p>Each item() in the loop represents a numeric month (1 to 12). This enables sequential iteration over all months of the year. The loop was set to execute <strong>sequentially</strong> to maintain data load order and prevent concurrency issues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*St_MZBDT5XDLt1qTF553OA.png" /><figcaption>ForEach activity configured to iterate through months January–December</figcaption></figure><h4>Configure the Copy Data Activity</h4><p>Inside the loop, I added a <strong>Copy Data activity</strong> that performs the month-wise ETL operation.</p><p><em>Source Configuration:</em></p><p>The dataset uses the p_month parameter in the path. The month is dynamically formatted to two digits using this expression:</p><p>@{if(greater(item(),9), string(item()), concat(&#39;0&#39;, string(item())))}</p><p>This expression formats month numbers into two-digit strings for consistent file naming — 1 becomes &quot;01&quot; and 10 stays &quot;10&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*_kWSvxUX8yu6NtEBZaO4PA.png" /><figcaption>Copy activity source setup with parameterized path and expression for month formatting.</figcaption></figure><p><em>Sink Configuration</em></p><p>The destination path in <strong>Azure Data Lake</strong> is dynamically set to organize data by month. The data is written in <strong>Parquet format</strong>, ensuring it’s analytics-ready and efficiently compressed. This keeps the storage structure neat, versioned, and ready for downstream analytics.</p><h3>Optimization</h3><p>ADF’s expression-based month formatting streamlined my pipeline logic, eliminating branching and future-proofing it for scalable ingestion. Thanks to parameterization, I reused key components without hardcoding, making the solution clean, flexible, and easy to maintain.</p><h3>Final Thoughts</h3><p>What started as a repetitive manual task evolved into a modular pipeline design that’s:</p><ul><li>Scalable across multiple months or years</li><li>Easy to maintain and tweak</li><li>Fully automated and parameter-driven</li></ul><p>By leveraging ADF’s powerful looping and expression features, this solution proves that even simple logic can unlock major time savings.</p><h3>Resources</h3><ul><li><a href="https://www.nyc.gov/site/tlc/about/tlc-trip-record-data.page">NYC Taxi Trip Records</a></li><li><a href="https://learn.microsoft.com/en-us/azure/data-factory/introduction">Azure Data Factory Documentation</a></li><li><a href="https://parquet.apache.org/documentation/latest/">Apache Parquet Format</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d86aeca1cc3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>