<?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 FishersOfData on Medium]]></title>
        <description><![CDATA[Stories by FishersOfData on Medium]]></description>
        <link>https://medium.com/@syat5432?source=rss-69600d5088a7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wlgPuL2Kdy_WKU1mkxAqsA.png</url>
            <title>Stories by FishersOfData on Medium</title>
            <link>https://medium.com/@syat5432?source=rss-69600d5088a7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 15:43:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@syat5432/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[When a Green Pipeline Doesn’t Mean Good Data: My Learnings So Far on Production-Grade Data…]]></title>
            <link>https://medium.com/@syat5432/when-a-green-pipeline-doesnt-mean-good-data-my-learnings-so-far-on-production-grade-data-066d9760a4c5?source=rss-69600d5088a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/066d9760a4c5</guid>
            <dc:creator><![CDATA[FishersOfData]]></dc:creator>
            <pubDate>Mon, 19 Oct 2026 18:24:46 GMT</pubDate>
            <atom:updated>2026-10-19T18:24:46.361Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XiyocwFaX4WSgo7BLOfZHA.png" /></figure><h3>When a Green Pipeline Doesn’t Mean Good Data: My Learnings So Far on Production-Grade Data Engineering</h3><p>As I learn more about data engineering, one thing I am gradually beginning to appreciate is that getting a data pipeline to run successfully is only part of the job.</p><p>We extract data, transform it, load it into the target table, check the output, and see that everything looks good. The job status is green, the logs show success, and we move on to the next task.</p><p>But what if the same record gets processed twice? What if a source column suddenly disappears? What if a batch fails halfway through, or a record arrives three days later than expected?</p><p>Apparently, production data doesn’t always follow the assumptions we made during development. Quite inconsiderate of it!</p><p>This got me thinking about the importance of considering test scenarios and failure behaviour before calling a data pipeline production-ready.</p><p>I thought I would share a few things I have been learning along the way.</p><h4>1. A Successful Pipeline Run Doesn’t Always Mean Correct Data</h4><p>Consider a simple ETL pipeline that extracts customer transactions, applies transformations, and loads the results into a target table.</p><p>The pipeline runs without errors. All the transformations execute successfully. The target table contains records.</p><p>Everything seems fine until we discover that duplicate transactions have inflated the total revenue.</p><p>The pipeline did exactly what we programmed it to do, but the resulting data was incorrect.</p><p>This is one distinction I am learning to pay more attention to:</p><p><strong>Technical success and data correctness are not necessarily the same thing.</strong></p><p>For data engineers, validating a pipeline should involve more than checking its execution status. It should also include verifying record counts, business rules, data quality, duplicate handling, and the correctness of the final output.</p><p>A green job status is encouraging, of course. But sometimes, the data needs a little more questioning before we celebrate!</p><h4>2. The Test Cases Worth Thinking About Before Writing the Code</h4><p>One practice I find useful is preparing a test matrix before implementing the logic or, at the very least, before considering it complete.</p><p>Instead of testing only the expected scenario, it helps to think about what could happen when the input, execution environment, or data volume differs from our assumptions.</p><p>Here are some scenarios I would consider when building an ETL or ELT pipeline.</p><h4>Data Pipeline Testing Checklist</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*jAso0vNHpl00hOeZTo3K8Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*KxPcHN0L_k-mv6vq73mvmA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*Wa4cxHhV-v6GSaqXW8CCaw.png" /></figure><p>These are just few checklists, for each use-cases that we may be working on, thinking various edge cases like a pro will spike in as we are in the battle field of development. Not every pipeline needs every test. The appropriate scenarios depend on the business requirements, architecture, data characteristics, and risks involved.</p><h4>3. Production-Grade Code Is About More Than Transformations</h4><p>Another thing I am learning is that reliable data engineering requires more than writing correct SQL queries or PySpark transformations.</p><p>There are several considerations that can make a significant difference when a pipeline operates in a production environment.</p><ul><li><strong>Input validation:</strong> Check required fields, schemas, data types, and business rules before processing records.</li><li><strong>Data quality:</strong> Identify invalid records and preserve enough information to investigate them instead of silently dropping them.</li><li><strong>Idempotency:</strong> Design processing so repeated executions do not create unintended duplicate effects.</li><li><strong>Logging and monitoring:</strong> Capture batch IDs, record counts, processing duration, failures, and other useful operational metrics.</li><li><strong>Error handling:</strong> Distinguish between recoverable failures, invalid records, and failures that require intervention.</li><li><strong>Incremental processing:</strong> Ensure that watermarks, checkpoints, and change-detection logic do not unintentionally skip or reprocess records.</li><li><strong>Performance:</strong> Consider query plans, partitioning, increasing input data sizes, file sizes, data skew, and resource usage where relevant.</li><li><strong>Security and configuration:</strong> Keep credentials out of source code and manage environment-specific settings appropriately.</li></ul><p>For example, imagine a pipeline that uses a watermark to identify new records.</p><p>If the watermark advances before the corresponding data is safely committed, a failure could cause records to be missed during the next run.</p><p>This is why I am beginning to see testing and implementation as closely connected.</p><p>A good test plan does not simply validate the code after it is written; it can also reveal weaknesses in the design itself.</p><h4>4. What Happens When the Pipeline Fails Halfway Through?</h4><p>One question I find particularly useful to consider is:</p><p><em>What should happen if this step fails halfway through?</em></p><p>Imagine a pipeline that reads a source file, validates its records, and writes them into a target table.</p><p>Suppose the write fails after some records have already been committed. What happens when the job is retried?</p><ul><li>Will previously written records be inserted again?</li><li>Can the pipeline identify which batch failed?</li><li>Will invalid records remain available for investigation?</li><li>Can processing resume without losing records?</li><li>Will the target remain consistent?</li></ul><p>Depending on the architecture, the answers might involve transactional writes, deterministic batch identifiers, deduplication logic, checkpoints, or a carefully designed recovery mechanism.</p><p>The important part is to test the resulting state, not merely check whether an exception was raised.</p><p>For example, after simulating a failure, we could verify that:</p><ol><li>The target contains the expected records.</li><li>Invalid records have been handled appropriately.</li><li>Rerunning the same batch does not introduce unintended duplicates.</li><li>The pipeline can identify the failed batch and recover as intended.</li></ol><p>Of course, the implementation will differ between systems such as Spark, Snowflake, and cloud-based data pipelines.</p><p>But the underlying question remains the same:</p><p><strong>Can the pipeline recover safely when something goes wrong?</strong></p><p>Because, realistically, a production pipeline will eventually encounter something unexpected. The goal is to make sure that one failure does not turn into three new problems.</p><h4>5. Are All the Source Tables Ready?</h4><p>Another important scenario is when a pipeline depends on multiple source tables that are refreshed at different times.</p><p>For example, a reporting job may depend on customers, orders, and payments. Even if the job starts on schedule and runs successfully, one of these tables might still contain outdated data because its upstream pipeline hasn&#39;t completed.</p><p>This can lead to incomplete or inconsistent reports despite a successful execution.</p><p>Before triggering a downstream job, it’s important to verify that all required source tables have completed their expected loads and contain sufficiently fresh, consistent data.</p><p>Some questions worth considering:</p><ul><li>Have all upstream jobs completed successfully?</li><li>Do the source tables contain data for the expected batch or processing date?</li><li>What happens if one upstream pipeline is delayed or fails?</li><li>Should the downstream job wait, retry, or raise an alert?</li></ul><p><strong>A pipeline should not depend only on when it is scheduled to run, but also on whether its required data is ready to be processed.</strong></p><h4>6. A Practical Approach Before Calling the Pipeline Complete</h4><p>The approach I am gradually trying to build towards is relatively simple.</p><p><strong>Step 1: Understand the Requirement</strong></p><p>Define the expected inputs, outputs, transformation rules, business constraints, and data quality requirements.</p><p><strong>Step 2: Identify Possible Failure Scenarios</strong></p><p>Think about missing data, duplicates, invalid schemas, late-arriving records, retries, concurrency, and increasing data volumes.</p><p><strong>Step 3: Define the Expected Outcome for Each Scenario</strong></p><p>Sometimes the correct behaviour is successful processing. Sometimes it is rejecting an individual record, quarantining invalid data, or failing a batch with a meaningful error.</p><p><strong>Step 4: Implement the Logic in Testable Units</strong></p><p>Keeping extraction, validation, transformation, and loading responsibilities reasonably clear makes it easier to test individual components.</p><p><strong>Step 5: Automate the Tests</strong></p><p>Unit tests can validate transformation logic, integration tests can verify interactions between components, and end-to-end tests can validate critical pipeline behaviour.</p><p><strong>Step 6: Verify Operational Readiness</strong></p><p>Check logging, monitoring, record reconciliation, performance, and recovery behaviour before treating the pipeline as production-ready.</p><p>Not every project requires a complicated testing framework from day one.</p><p>The idea is to make testing proportionate to the risks involved and to avoid assuming that a successful local run proves everything is working correctly.</p><h4>A Small Learning I Wanted to Share</h4><p>I am beginning to realise that better data engineering does not necessarily start with writing more code or using more sophisticated technologies.</p><p>Sometimes, it starts with asking better questions before writing the first line.</p><p>What assumptions am I making about the source data?</p><p>What happens if those assumptions are violated?</p><p>Can the pipeline recover safely?</p><p>Will rerunning the job produce the intended result?</p><p>And how will I know if something goes wrong after deployment?</p><p>These questions become particularly important in data engineering, where a pipeline can complete successfully and still produce incomplete, duplicated, or misleading data.</p><p>I still find it useful to start with a simple working implementation. The difference is that I am learning not to treat that first successful run as the finish line.</p><p><strong>Perhaps the real milestone is not when a pipeline runs successfully for the first time, but when we have enough confidence in how it behaves when things do not go as planned.</strong></p><p>After all, the data may be unexpected, the network may disappear, and the job may fail just before a scheduled dashboard refresh.</p><p>The least we can do is prepare our pipelines for the possibility that production will not be as peaceful as our development environment!</p><p><em>Just sharing a few things I have been learning as I explore what it takes to build more reliable, production-grade data pipelines. There is always more to learn, and I would be interested to hear what test scenarios other data engineers consider essential before deploying their pipelines.</em></p><p>Happy Learning 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=066d9760a4c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Snowflake Clustering-The Art of Helping Queries Find Data Faster]]></title>
            <link>https://medium.com/@syat5432/snowflake-clustering-the-art-of-helping-queries-find-data-faster-0ce12af4abf8?source=rss-69600d5088a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ce12af4abf8</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[sql-query-performance]]></category>
            <category><![CDATA[clustering]]></category>
            <dc:creator><![CDATA[FishersOfData]]></dc:creator>
            <pubDate>Thu, 15 Oct 2026 14:42:01 GMT</pubDate>
            <atom:updated>2026-10-15T14:42:01.329Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yPAZUi7Gq6tkVpFqdGTO4w.png" /></figure><p>While learning Snowflake, I came across a question that made me curious:</p><p><strong>If Snowflake automatically organizes data into micro-partitions and skips unnecessary data, why do we need clustering?</strong></p><p>At first, clustering sounded like another database concept that I needed to add to my growing list of things to learn. But the more I explored it, the more it connected to a real-world problem: how the way data is stored can affect the way queries perform.</p><p>Here are a few things I learned along the way.</p><h3>1. Snowflake already organizes data!</h3><p>Snowflake automatically divides table data into small storage units called <em>micro-partitions</em> and maintains metadata about them, including minimum and maximum values for columns.</p><p>Consider a sales table containing millions of records.</p><p>Micro-partitionOrder date rangeMP1 Jan 1–10, MP2 Jan 11–20, MP3 Jan 21–31,MP4 Feb 1–10</p><p>Now, imagine a query requesting orders from January 15.</p><pre>SELECT *<br>FROM SALES<br>WHERE ORDER_DATE = &#39;2026-01-15&#39;;</pre><p>Snowflake can identify MP2 as the relevant micro-partition and skip the others.</p><p>This is called <strong>micro-partition pruning</strong>.</p><p>I like to think of it as a librarian who knows which shelf contains a book instead of asking every book in the library to introduce itself.</p><h3>2. Then came the confusing question: Why clustering?</h3><p>If Snowflake is already smart enough to skip unnecessary data, what exactly is clustering solving?</p><p>The answer became clearer when I imagined a different data layout.</p><p>Suppose every micro-partition contains orders from January through December. A query requesting orders from January might need to examine every micro-partition because every one of them contains January data.</p><p>The problem isn’t necessarily the amount of data returned. It’s the amount of data Snowflake may have to scan to find it.</p><p>Now imagine the data is organized more effectively:</p><p>Micro-partitionOrder date range MP1 Jan–Mar ,MP2 Apr–Jun ,MP3 Jul–Sep, MP4 Oct–Dec</p><p>A query for January could potentially scan only MP1.</p><p><strong>That’s the central idea behind clustering: improving data organization so Snowflake can eliminate more unnecessary scanning.</strong></p><p>Of course, these are simplified examples. Real micro-partitions can contain overlapping ranges, and the actual improvement depends on the data and query patterns.</p><h3>3. What if clustering isn’t used?</h3><p>I explored this through a practical example.</p><p>Imagine an e-commerce company with billions of orders collected over five years. Analysts frequently query recent orders, monthly revenue, and sales by region.</p><p>If the data arrives in an order that doesn’t align well with these queries, Snowflake might scan a large number of micro-partitions even when the query returns relatively few records.</p><p>This can lead to longer query execution times and increased compute consumption.</p><p>But one important detail stood out to me: <strong>a table without an explicit clustering key isn’t automatically inefficient.</strong></p><p>Snowflake already organizes data automatically. If the data arrives in a naturally useful order and its micro-partitions have good metadata ranges, performance may already be excellent.</p><p>So clustering isn’t a compulsory decoration for every table. Sometimes the existing organization is perfectly fine.</p><h3>4. My first practical look at CLUSTER BY</h3><p>Suppose the sales table is frequently queried using order dates.</p><pre>CREATE TABLE SALES (<br>    ORDER_ID NUMBER,<br>    ORDER_DATE DATE,<br>    CUSTOMER_ID NUMBER,<br>    REGION VARCHAR,<br>    AMOUNT NUMBER(12,2)<br>)<br>CLUSTER BY (ORDER_DATE);</pre><p>For an existing table, the key can be defined using:</p><pre>ALTER TABLE SALES<br>CLUSTER BY (ORDER_DATE);</pre><p>This defines the intended clustering key. Snowflake’s Automatic Clustering service can then reorganize data when it determines that maintenance is beneficial.</p><p>One detail I found interesting: adding a clustering key doesn’t mean the table is instantly sorted like a spreadsheet.</p><p>There is no magical Snowflake employee running around with a broom, arranging every row the moment the SQL statement finishes!</p><p>Clustering is a physical data organization process, and maintaining that organization can consume compute resources.</p><h3>5. What happens when multiple columns are involved?</h3><p>Real-world queries rarely follow one perfectly predictable pattern.</p><p>For example, an analytics team might frequently query sales by both date and region.</p><pre>CREATE TABLE SALES (<br>    ORDER_ID NUMBER,<br>    ORDER_DATE DATE,<br>    REGION VARCHAR,<br>    AMOUNT NUMBER(12,2)<br>)<br>CLUSTER BY (ORDER_DATE, REGION);</pre><p>A query could then look like this:</p><pre>SELECT SUM(AMOUNT)<br>FROM SALES<br>WHERE ORDER_DATE BETWEEN &#39;2026-01-01&#39; AND &#39;2026-01-31&#39;<br>  AND REGION = &#39;South&#39;;</pre><p>A multi-column clustering key can help when the data layout and query predicates align with those columns.</p><p>However, adding more columns doesn’t automatically mean better performance. The order of expressions, data cardinality, and actual workload all matter.</p><p>I found this particularly interesting because database optimization is not about adding as many features as possible. It’s about understanding the problem each feature solves.</p><h3>6. A few advanced concepts I discovered</h3><p><strong>Clustering depth</strong></p><p>Snowflake provides clustering information that helps evaluate how micro-partitions overlap for particular clustering dimensions.</p><pre>SELECT SYSTEM$CLUSTERING_INFORMATION(<br>    &#39;MY_DATABASE.MY_SCHEMA.SALES&#39;<br>);</pre><p>To evaluate a potential key on an existing table:</p><pre>SELECT SYSTEM$CLUSTERING_INFORMATION(<br>    &#39;MY_DATABASE.MY_SCHEMA.SALES&#39;,<br>    &#39;(ORDER_DATE)&#39;<br>);</pre><p>Lower clustering depth generally indicates less overlap, which can be beneficial. However, it isn’t a universal performance score. Query profiles and actual execution measurements still matter.</p><p><strong>Cardinality</strong></p><p>Cardinality refers to the number of distinct values in a column.</p><p>A column such as IS_ACTIVE might contain only two values, whereas ORDER_ID might contain millions of unique values.</p><p>A very low-cardinality column may not provide enough pruning benefits on its own. Extremely high-cardinality keys can also be expensive to maintain.</p><p>The useful clustering key depends on the workload rather than cardinality alone.</p><p><strong>Automatic Clustering costs</strong></p><p>This was another important discovery: better organization isn’t free.</p><p>When data changes, Snowflake may need to perform additional clustering maintenance. On a large table with frequent updates and inserts, the cost of maintaining a clustering key can become significant.</p><p>The performance improvement needs to justify the additional credits consumed.</p><h3>7. Where can clustering be used?</h3><p>I learned that clustering keys are supported on standard Snowflake tables and eligible materialized views. Hybrid tables do not support clustering keys.</p><p>Clustering expressions can also be useful. For instance, if queries usually filter by calendar date rather than exact timestamp, a date expression might be worth evaluating:</p><pre>CLUSTER BY (TO_DATE(EVENT_TS))</pre><p>The idea is to align the physical organization with how the data is queried, rather than choosing a key simply because the column exists.</p><h3>Final thoughts</h3><p>My biggest takeaway from learning Snowflake clustering was that <strong>query performance depends not only on how much data a query returns, but also on how effectively Snowflake can avoid scanning irrelevant data.</strong></p><p>Micro-partitions provide the foundation. Pruning reduces unnecessary work. Clustering can improve the physical organization when the natural data layout isn’t sufficient.</p><p>And perhaps the most useful lesson is this: in data engineering, not every optimization needs to be applied everywhere.</p><p>After all, the goal isn’t to make the warehouse work harder. It’s to help it do less unnecessary work — and leave more credits available for the next interesting experiment.</p><h3>References I found useful</h3><ul><li><a href="https://docs.snowflake.com/en/user-guide/tables-clustering-micropartitions">Snowflake: Micro-partitions and data clustering</a></li><li><a href="https://docs.snowflake.com/en/user-guide/tables-clustering-keys">Snowflake: Clustering keys and clustered tables</a></li></ul><p>Happy Learning 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ce12af4abf8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning to Become More Effective as a Data Engineer using AI]]></title>
            <link>https://medium.com/@syat5432/learning-to-become-more-effective-as-a-data-engineer-using-ai-6b027b3bce29?source=rss-69600d5088a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b027b3bce29</guid>
            <dc:creator><![CDATA[FishersOfData]]></dc:creator>
            <pubDate>Thu, 24 Sep 2026 17:31:20 GMT</pubDate>
            <atom:updated>2026-09-24T17:31:20.121Z</atom:updated>
            <content:encoded><![CDATA[<p>AI is becoming a bigger part of the way we work, and like many Data Engineers, I’m also trying to understand how I can use it effectively in my day-to-day work.</p><p>I’m still learning. I don’t have all the answers, but one thought that has been coming to my mind is:</p><p><strong>Instead of only asking, “How do I use AI?”<br>Maybe I should also ask, “How can AI help me become more effective at what I already do?”</strong></p><p>This is the approach I’m starting to explore.</p><h3>Start with the work I already do</h3><p>Rather than trying to learn every new AI tool, I want to begin with the tasks I already encounter as a Data Engineer.</p><p>For example:</p><ul><li>Writing SQL</li><li>Working with Python</li><li>Building or understanding pipelines</li><li>Debugging errors</li><li>Investigating data issues</li><li>Understanding unfamiliar code</li><li>Writing documentation</li><li>Learning new technologies</li></ul><p>The first step is simply to observe where I spend the most time and where AI could potentially help.</p><h3>Use AI to Learn, Not Just to Get Answers</h3><p>One thing I’m realizing is that AI can be useful not only for getting solutions, but also for learning.</p><p>For example, instead of asking:</p><blockquote><em>“Give me the SQL query.”</em></blockquote><p>I can ask:</p><blockquote><em>“Help me understand how I should approach this SQL problem and explain why this approach works.”</em></blockquote><p>Similarly, when I encounter an unfamiliar Data Engineering concept, I can ask AI to explain it with a practical example and then verify my understanding through documentation and hands-on practice.</p><p>This makes the process more about <strong>learning with AI rather than simply getting answers from AI.</strong></p><h3>Use AI During Problem Solving</h3><p>When I face an error, I can provide the relevant context and ask AI to help me think through possible causes.</p><p>Instead of:</p><blockquote><em>“Fix this error.”</em></blockquote><p>I can ask:</p><blockquote><em>“Here is the error and my approach. What could be causing it? What should I check first?”</em></blockquote><p>This gives me an opportunity to understand the problem instead of immediately jumping to a solution.</p><h3>Use AI to Review My Work</h3><p>Another area I’m beginning to explore is using AI after completing a task.</p><p>For example:</p><blockquote><em>“Review my SQL and point out possible performance, correctness or edge-case issues.”</em></blockquote><p>Or:</p><blockquote><em>“Review this pipeline design and tell me what I might have overlooked.”</em></blockquote><p>I may not agree with every suggestion, but that’s actually part of the learning.</p><p>I can ask <strong>why</strong> a suggestion was made and decide whether it makes sense for the particular situation.</p><h3>Keep the Fundamentals Strong</h3><p>One thing I don’t want to lose while learning AI is the importance of Data Engineering fundamentals.</p><p>SQL, Python, databases, data modeling, distributed systems, cloud platforms, debugging and understanding the business problem are still important.</p><p>AI can help me work faster, but I still need enough understanding to question, verify and test what it produces.</p><p>So my approach is becoming:</p><p><strong>AI suggests → I understand → I verify → I test → I learn</strong></p><h3>A Small Experiment</h3><p>Rather than trying to completely change my workflow, I’m planning to start small.</p><p>For the next few weeks, I can pick one task at a time and ask:</p><p><strong>Where could AI help me?</strong></p><p>Then I’ll observe:</p><ul><li>Did it save time?</li><li>Did it help me understand something better?</li><li>Was its suggestion actually correct?</li><li>What did I learn from the process?</li><li>Could I have solved the problem differently?</li></ul><p>Over time, these small experiments may help me discover where AI genuinely adds value to my work.</p><p>I’m still at the beginning of this journey, and this isn’t a definitive guide on using AI as a Data Engineer.</p><p>It’s simply a learning approach I’m starting to explore.</p><p>It’s to gradually become a better Data Engineer by learning <strong>where AI can complement my existing skills, improve my thinking and help me work more effectively.<br>Happy Learning 😊</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b027b3bce29" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AutoSys vs dbt: Why Do Data Teams Need Both?]]></title>
            <link>https://medium.com/@syat5432/autosys-vs-dbt-why-do-data-teams-need-both-2b177f9e4995?source=rss-69600d5088a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b177f9e4995</guid>
            <dc:creator><![CDATA[FishersOfData]]></dc:creator>
            <pubDate>Sat, 19 Sep 2026 11:41:13 GMT</pubDate>
            <atom:updated>2026-09-19T11:41:13.602Z</atom:updated>
            <content:encoded><![CDATA[<p>A common question in Data Engineering is:</p><blockquote><strong><em>“If AutoSys or Airflow already orchestrates our data pipelines, why do we need dbt?”</em></strong></blockquote><p>The answer lies in understanding the difference between <strong>orchestration</strong> and <strong>transformation</strong>.</p><h3>A Simple Scenario</h3><p>Consider an e-commerce company that receives order data from an operational database and prepares it for reporting.</p><p>The pipeline looks like this:</p><pre>Source Database<br>      ↓<br>Extract Orders<br>      ↓<br>Load to Snowflake<br>      ↓<br>Transform Data<br>      ↓<br>Reporting Tables</pre><p>AutoSys can manage the workflow:</p><pre>Job 1: Extract<br>   ↓<br>Job 2: Load to Snowflake<br>   ↓<br>Job 3: Run Transformations</pre><p>It handles scheduling, dependencies, retries, monitoring, and coordination between different systems.</p><p>But suppose the transformation layer contains:</p><pre>raw_orders<br>     ↓<br>customer_sales<br>     ↓<br>customer_segments<br>     ↓<br>customer_metrics</pre><p>Each transformation may contain different SQL logic and dependencies.</p><p>This is where dbt helps.</p><h3>What dbt adds?</h3><p>Instead of managing transformation SQL as independent scripts, dbt organizes them as <strong>models</strong>.</p><p>For example:</p><pre>-- customer_segments.sql</pre><pre>SELECT<br>    customer_id,<br>    CASE<br>        WHEN total_sales &gt;= 10000 THEN &#39;Premium&#39;<br>        ELSE &#39;Standard&#39;<br>    END AS segment<br>FROM {{ ref(&#39;customer_sales&#39;) }}</pre><p>The ref() tells dbt that customer_segments depends on customer_sales.</p><p>dbt can therefore understand:</p><pre>customer_sales<br>      ↓<br>customer_segments</pre><p>It also provides features such as:</p><ul><li>Data quality tests</li><li>Transformation lineage</li><li>Documentation</li><li>Reusable SQL/macros</li><li>Incremental models</li></ul><p>For example, you can define a test to ensure customer_id is not null or duplicated.</p><h3>Why not just use AutoSys?</h3><p>You can.</p><p>For a small number of SQL transformations, AutoSys running SQL scripts may be perfectly adequate.</p><p>The challenge comes when the transformation layer becomes large:</p><pre>100+ transformation models<br>Many dependencies<br>Multiple developers<br>Data quality requirements<br>Frequent changes</pre><p>At that point, dbt provides structure specifically for managing the transformation layer.</p><h3>Why not use only dbt?</h3><p>Because dbt is not designed to manage the entire pipeline.</p><p>For example:</p><pre>Snowflake<br>    ↓<br>Generate File<br>    ↓<br>SFTP<br>    ↓<br>External System<br>    ↓<br>Receive File<br>    ↓<br>Load to Snowflake</pre><p>Waiting for files, transferring data, interacting with external systems, scheduling, and retries are orchestration responsibilities.</p><p>AutoSys or Airflow is better suited for these tasks.</p><h3>How they work together</h3><p>A common architecture is:</p><pre>AutoSys / Airflow<br>                     ↓<br>              Data Ingestion<br>                     ↓<br>                  Snowflake<br>                     ↓<br>                    dbt<br>                     ↓<br>          Business / Reporting Models</pre><p>The responsibilities are simple:</p><p><strong>AutoSys / Airflow</strong></p><blockquote><strong><em>“When should this workflow run, and what should happen next?”</em></strong></blockquote><p><strong>dbt</strong></p><blockquote><strong><em>“How should the data be transformed, tested, and organized?”</em></strong></blockquote><p><strong>Snowflake</strong></p><blockquote><strong><em>“Where should the data be stored and where should the SQL execute?”</em></strong></blockquote><h3>Final Takeaway</h3><p>AutoSys and dbt are not necessarily alternatives.</p><p>They solve different layers of the Data Engineering problem:</p><pre>AutoSys → Orchestration<br>dbt     → Transformation<br>Snowflake → Data Warehouse</pre><p>If pipeline is mainly about <strong>scheduling and coordinating multiple systems</strong>, orchestration tools remain essential.</p><p>If Snowflake transformation layer is becoming complex, dbt can bring structure through <strong>models, dependencies, testing, documentation, and lineage</strong>.</p><p>Happy Learning!😊😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b177f9e4995" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When Data Lives in More Than One Platform: Understanding Databricks to Snowflake Data Movement]]></title>
            <link>https://medium.com/@syat5432/when-data-lives-in-more-than-one-platform-understanding-databricks-to-snowflake-data-movement-7815abc7b175?source=rss-69600d5088a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/7815abc7b175</guid>
            <dc:creator><![CDATA[FishersOfData]]></dc:creator>
            <pubDate>Sun, 13 Sep 2026 17:29:38 GMT</pubDate>
            <atom:updated>2026-09-13T17:30:43.223Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NLlqqYwb4iLJ7RrpgfdEbA.png" /></figure><p>Modern data platforms rarely consist of a single technology.</p><p>A typical organization may have:</p><ul><li>Operational databases</li><li>Object storage</li><li>Data processing platforms</li><li>Data warehouses</li><li>BI tools</li><li>Machine learning platforms</li><li>Data applications</li></ul><p>Each system may be optimized for a different workload.</p><p>This creates an important architectural question:</p><blockquote><strong><em>When data is processed in one platform but consumed in another, how should that data move between them?</em></strong></blockquote><p>One common example is <strong>Databricks and Snowflake</strong>.</p><p>But before discussing how to move data between them, it is important to understand <strong>why a company would use both in the first place</strong>.</p><h3>Why Do Companies Use Multiple Data Platforms?</h3><p>Consider a company collecting billions of application events every day.</p><p>The raw data may first land in a data lake:</p><pre>Applications<br>     ↓<br>Data Lake<br>     ↓<br>Raw Data</pre><p>The engineering team may then need to perform:</p><ul><li>Large-scale transformations</li><li>Data cleansing</li><li>Complex joins</li><li>Feature engineering</li><li>Machine learning preparation</li></ul><p>A distributed processing platform can be useful for these workloads.</p><p>After processing, business users may need:</p><ul><li>SQL analytics</li><li>Dashboards</li><li>Reporting</li><li>Business intelligence</li><li>Data sharing</li><li>Application-facing analytics</li></ul><p>This can lead to an architecture such as:</p><pre>Data Sources<br>                      ↓<br>                Data Platform A<br>                      ↓<br>              Processing / ETL<br>                      ↓<br>                Curated Data<br>                      ↓<br>                Data Platform B<br>                      ↓<br>              BI / Analytics</pre><p>This is where platforms such as <strong>Databricks and Snowflake</strong> can coexist.</p><p>The goal isn’t necessarily to use two platforms because one is incapable of doing the other’s job.</p><p>Instead, an organization may choose to use each platform where it provides the most value.</p><h3>Databricks and Snowflake: Different Roles, Overlapping Capabilities</h3><p>Databricks is widely used for data engineering, Spark-based processing, machine learning and large-scale data workloads.</p><p>Snowflake is widely used for cloud data warehousing, SQL analytics, BI and governed data consumption.</p><p>A simplified architecture could therefore look like:</p><pre>Data Sources<br>                     ↓<br>                 Databricks<br>                     ↓<br>             Data Processing<br>                     ↓<br>             Curated Datasets<br>                     ↓<br>                 Snowflake<br>                     ↓<br>             Analytics / BI</pre><p>However, this immediately creates another problem:</p><blockquote><strong><em>How do we transfer the curated data from Databricks to Snowflake?</em></strong></blockquote><p>The answer depends on the requirements.</p><h3>The Main Ways to Move Data</h3><p>There are several approaches.</p><p>The most common patterns are:</p><ol><li>Direct transfer using the Snowflake Spark Connector</li><li>Databricks → Object Storage → Snowflake</li><li>Databricks → Snowflake Internal Stage → Table</li><li>Avoiding physical movement through federation or external access</li></ol><p>Each has a different purpose.</p><h3>1. Direct Databricks → Snowflake Using the Spark Connector</h3><p>When the data already exists as a Spark DataFrame, the simplest architecture can be a direct connection.</p><pre>Databricks<br>    ↓<br>Spark DataFrame<br>    ↓<br>Snowflake Spark Connector<br>    ↓<br>Snowflake</pre><p>For example:</p><pre>df.write \<br>    .format(&quot;snowflake&quot;) \<br>    .options(**snowflake_options) \<br>    .option(&quot;dbtable&quot;, &quot;ANALYTICS.SALES&quot;) \<br>    .mode(&quot;append&quot;) \<br>    .save()</pre><p>The Snowflake Spark Connector is designed to allow Spark applications to read from and write to Snowflake.</p><h3>When is this useful?</h3><p>Suppose Databricks performs:</p><pre>Raw Data<br>   ↓<br>PySpark<br>   ↓<br>Cleaning<br>   ↓<br>Aggregation<br>   ↓<br>Curated Dataset</pre><p>and Snowflake is the only downstream consumer.</p><p>There may be little value in introducing another storage layer.</p><p>The pipeline can simply be:</p><pre>Databricks<br>    ↓<br>Curated Data<br>    ↓<br>Snowflake</pre><h3>Advantages</h3><ul><li>Simple architecture</li><li>Fewer infrastructure components</li><li>Natural integration with Spark</li><li>No separately managed object-storage exchange layer</li><li>Convenient for batch data movement</li></ul><h3>Drawbacks</h3><p>The platforms become more tightly coupled.</p><p>You also need to manage:</p><ul><li>Connector configuration</li><li>Authentication</li><li>Network connectivity</li><li>Schema compatibility</li><li>Retry handling</li><li>Load failures</li><li>Snowflake compute usage</li></ul><p>A common mistake is to use:</p><pre>.mode(&quot;overwrite&quot;)</pre><p>for every production run.</p><p>For a large table, repeatedly replacing the entire dataset can be expensive and inefficient.</p><p>A production design may instead use:</p><pre>New/Changed Data<br>       ↓<br>Snowflake Staging<br>       ↓<br>MERGE<br>       ↓<br>Target Table</pre><h3>2. Databricks → Object Storage → Snowflake</h3><p>Another common pattern is to use object storage as an exchange layer.</p><p>For example:</p><pre>Databricks<br>     ↓<br>Parquet<br>     ↓<br>Object Storage<br>     ↓<br>Snowflake Stage<br>     ↓<br>Snowflake Table</pre><p>The object store could be:</p><ul><li>Amazon S3</li><li>Google Cloud Storage</li><li>Azure Blob Storage</li></ul><p>For example:</p><pre>Databricks<br>     ↓<br>S3<br>     ↓<br>Snowflake External Stage<br>     ↓<br>COPY INTO<br>     ↓<br>Snowflake</pre><p>Snowflake can load files using commands such as:</p><pre>COPY INTO ANALYTICS.SALES<br>FROM @SALES_STAGE<br>FILE_FORMAT = (TYPE = PARQUET);</pre><h3>Why use object storage?</h3><p>Imagine Databricks produces a daily dataset:</p><pre>sales/<br>├── 2026-09-11/<br>├── 2026-09-12/<br>└── 2026-09-13/</pre><p>Those files could be consumed by several systems:</p><pre>Object Storage<br>                              │<br>                 ┌────────────┼────────────┐<br>                 ↓            ↓            ↓<br>             Snowflake      Athena        Spark</pre><p>The object store becomes a <strong>decoupling layer</strong>.</p><h3>Advantages</h3><p><strong>Decoupling</strong></p><p>Databricks and Snowflake don’t need to be directly dependent on each other for every transfer.</p><p><strong>Replayability</strong></p><p>If Snowflake fails to load a file, the file can remain available for another attempt.</p><p><strong>Interoperability</strong></p><p>Formats such as Parquet can be consumed by multiple technologies.</p><p><strong>Useful for large batch workloads</strong></p><p>Distributed systems can generate multiple files efficiently.</p><h3>Drawbacks</h3><p>You now have another system to operate.</p><p>You need to consider:</p><ul><li>Storage permissions</li><li>IAM</li><li>Encryption</li><li>File lifecycle</li><li>Retention</li><li>File naming</li><li>Partitioning</li><li>Small files</li><li>External stages</li><li>Storage costs</li></ul><p>For example, a poorly designed Spark job might generate thousands of tiny files:</p><pre>part-00001.parquet<br>part-00002.parquet<br>...<br>part-50000.parquet</pre><p>This can create unnecessary metadata and ingestion overhead.</p><h3>3. Databricks → Snowflake Internal Stage → Table</h3><p>Snowflake also provides internal stages.</p><p>Here, Snowflake manages the staging storage rather than requiring you to maintain an external object-storage location.</p><p>The architecture becomes:</p><pre>Databricks<br>     ↓<br>Parquet<br>     ↓<br>Snowflake Internal Stage<br>     ↓<br>COPY INTO<br>     ↓<br>Snowflake Table</pre><p>An internal stage can be created with:</p><pre>CREATE STAGE ANALYTICS.SALES_STAGE<br>FILE_FORMAT = (<br>    TYPE = PARQUET<br>);</pre><p>The files can then be loaded:</p><pre>COPY INTO ANALYTICS.SALES<br>FROM @ANALYTICS.SALES_STAGE<br>FILE_FORMAT = (<br>    TYPE = PARQUET<br>);</pre><h3>When is this useful?</h3><p>This approach fits a file-oriented batch architecture where you want:</p><pre>File arrives<br>     ↓<br>Stage<br>     ↓<br>Validate / load<br>     ↓<br>Table</pre><p>without maintaining your own external object-storage exchange layer.</p><h3>Advantages</h3><ul><li>Snowflake manages the stage</li><li>No customer-managed S3/GCS bucket is required</li><li>Useful for file-based ingestion</li><li>Clear separation between file arrival and table loading</li><li>Suitable for batch workflows</li></ul><h3>Drawbacks</h3><p>There is still an additional file-transfer step.</p><p>Instead of:</p><pre>DataFrame<br>   ↓<br>Snowflake</pre><p>you have:</p><pre>DataFrame<br>   ↓<br>File<br>   ↓<br>Stage<br>   ↓<br>COPY INTO<br>   ↓<br>Table</pre><p>If Snowflake is the only consumer and the data already exists as a Spark DataFrame, this may add unnecessary complexity.</p><h3>4. What If We Don’t Move the Data?</h3><p>Data movement itself isn’t always necessary.</p><p>Sometimes the better architecture is to query data where it already resides.</p><p>Conceptually:</p><pre>Analytics Platform<br>       │<br>       │ Query<br>       ↓<br>Another Data Platform</pre><p>rather than:</p><pre>Platform A<br>    ↓<br>Copy<br>    ↓<br>Platform B</pre><p>This is generally referred to as <strong>federated or cross-platform access</strong>, depending on the implementation.</p><h3>When can this make sense?</h3><p>For example, a company may have a dataset that should remain in one authoritative system.</p><p>Instead of maintaining two copies:</p><pre>Databricks<br>   ↓<br>Copy<br>   ↓<br>Snowflake</pre><p>the consuming system may query the source directly.</p><h3>Advantages</h3><ul><li>Avoids unnecessary data duplication</li><li>Reduces movement</li><li>Can simplify data ownership</li><li>Keeps a single source of truth</li></ul><h3>Drawbacks</h3><p>Remote querying can introduce:</p><ul><li>Network dependency</li><li>Latency</li><li>Performance considerations</li><li>Cross-platform query limitations</li><li>Different cost characteristics</li></ul><p>For heavily used dashboards, a locally materialized analytical table may still be preferable.</p><h3>Comparing the Approaches</h3><p>ApproachBest suited forMain advantageMain drawbackSpark ConnectorDirect Spark → SnowflakeSimpleTighter couplingObject StorageFile-based exchangeDecouplingMore infrastructureInternal StageSnowflake-managed stagingNo external object store requiredAdditional file stepFederationAvoiding data copiesSingle source of truthQuery performance/dependency</p><h3>Why Not Just Use One Platform?</h3><p>This is one of the most important architectural questions.</p><p>If Databricks and Snowflake can both process data, why maintain both?</p><p>Because organizations may already have:</p><ul><li>Existing investments</li><li>Different teams</li><li>Different workloads</li><li>Existing BI integrations</li><li>Governance requirements</li><li>Specialized skills</li><li>Vendor agreements</li><li>Performance requirements</li></ul><p>For example:</p><pre>Enterprise Data Platform<br>                          │<br>              ┌───────────┴───────────┐<br>              ↓                       ↓<br>          Databricks              Snowflake<br>              │                       │<br>       Data Engineering          Analytics<br>       Spark Processing          BI / Reporting<br>       ML / AI                   SQL Workloads</pre><p>But this doesn’t mean every organization should adopt both.</p><p>Using multiple platforms can also create significant disadvantages.</p><h3>The Cost of Moving Data Between Platforms</h3><h3>1. Data duplication</h3><p>Suppose a company has:</p><pre>Databricks → 50 TB<br>Snowflake  → 50 TB</pre><p>If both contain essentially the same data, the organization now has two copies to govern and maintain.</p><p>This creates questions such as:</p><blockquote><em>Which one is the source of truth?</em></blockquote><p>and:</p><blockquote><em>What happens if the two copies disagree?</em></blockquote><h3>2. Additional compute and storage</h3><p>A dual-platform architecture may involve:</p><pre>Databricks compute<br>+<br>Snowflake compute<br>+<br>Storage<br>+<br>Data transfer<br>+<br>Orchestration<br>+<br>Monitoring</pre><p>The business benefit needs to justify that additional cost.</p><h3>3. More failure points</h3><p>Consider:</p><pre>Databricks<br>     ↓<br>Export<br>     ↓<br>Storage<br>     ↓<br>Snowflake<br>     ↓<br>BI</pre><p>Any stage can fail.</p><p>A production pipeline therefore needs:</p><ul><li>Retries</li><li>Idempotency</li><li>Monitoring</li><li>Error handling</li><li>Reconciliation</li><li>Alerting</li></ul><h3>4. Data freshness</h3><p>Suppose the business requires data every 15 minutes.</p><p>A pipeline such as:</p><pre>Process<br> ↓<br>Export<br> ↓<br>Transfer<br> ↓<br>Load<br> ↓<br>Transform</pre><p>may introduce unnecessary latency.</p><p>The architecture should therefore start with the <strong>freshness requirement</strong>, not the technology.</p><h3>What Should a Data Engineer Evaluate?</h3><p>Before deciding how to move data, ask:</p><h3>Data volume</h3><p>Is the dataset:</p><pre>10 GB?<br>1 TB?<br>100 TB?</pre><h3>Frequency</h3><p>Is it:</p><pre>Daily?<br>Hourly?<br>Every few minutes?<br>Real-time?</pre><h3>Data format</h3><p>Would:</p><pre>Parquet<br>CSV<br>JSON<br>Delta</pre><p>be appropriate?</p><h3>Incremental strategy</h3><p>Can you transfer only:</p><pre>New data<br>+<br>Changed data</pre><p>instead of the entire dataset?</p><h3>Idempotency</h3><p>What happens if the same batch runs twice?</p><p>A robust pipeline should prevent unintended duplication.</p><h3>Schema evolution</h3><p>What happens when a column is:</p><pre>Added<br>Removed<br>Renamed<br>Changed in type</pre><p>?</p><h3>Security</h3><p>How are credentials and permissions handled?</p><p>Avoid embedding long-lived credentials directly into notebooks or application code.</p><h3>Reconciliation</h3><p>You should be able to compare:</p><pre>Source records<br>Transferred records<br>Loaded records<br>Rejected records</pre><p>and identify discrepancies.</p><h3>Cost</h3><p>Evaluate:</p><pre>Compute<br>Storage<br>Network transfer<br>Data movement<br>Operational overhead</pre><p>rather than looking only at the cost of the destination warehouse.</p><h3>The Most Important Architectural Principle</h3><p>If Databricks produces a curated dataset and Snowflake is the organization’s analytical serving layer, direct transfer through the Spark Connector may be the simplest solution.</p><p>If several systems need the same files, object storage may provide better decoupling.</p><p>If the pipeline is naturally file-oriented, an internal stage may be appropriate.</p><p>And if duplication provides no value, federation or direct access may be worth considering.</p><p>The best architecture is therefore not the one with the most technologies.</p><p>It is the one that satisfies the required <strong>performance, reliability, security, cost, governance and data-freshness requirements with the least unnecessary complexity</strong>.</p><p>Happy Learning! 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7815abc7b175" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Airport, the Translator, and the Database: Understanding SQLAlchemy, Connectors, and Snowflake]]></title>
            <link>https://medium.com/@syat5432/the-airport-the-translator-and-the-database-understanding-sqlalchemy-connectors-and-snowflake-9a8f10a935df?source=rss-69600d5088a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a8f10a935df</guid>
            <dc:creator><![CDATA[FishersOfData]]></dc:creator>
            <pubDate>Sat, 01 Aug 2026 09:29:53 GMT</pubDate>
            <atom:updated>2026-08-01T09:33:46.890Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MKRr0XHDCbB54e_fqU59Ew.png" /></figure><p><strong>Imagine arriving at an airport and asking:👨</strong></p><blockquote><em>“I want to go to Tokyo.”</em></blockquote><p>The travel desk understands the destination</p><p>But it doesn’t fly airplanes.</p><p>It needs an airline that can actually take passengers there.</p><p>If an airline is available, the journey begins.</p><p>If not, the desk responds:</p><blockquote><em>“I know where Tokyo is, but I don’t know how to get you there.”</em></blockquote><p>This simple situation mirrors how Python connects to databases.</p><p>Knowing the destination isn’t enough. A complete chain of components is required to understand the destination, establish communication, and complete the journey.</p><h4>A Common Snowflake Connection❄️</h4><p>Many Python applications connect to Snowflake using SQLAlchemy:</p><pre>from sqlalchemy import create_engine</pre><pre>engine = create_engine(<br>    &quot;snowflake://user:password@account/database/schema&quot;<br>)</pre><p>At first glance, this looks like a single operation.</p><p>In reality, several layers work together behind the scenes.</p><p>Understanding these layers helps explain why certain connection errors occur and how modern database connectivity is designed.</p><h4>SQLAlchemy: The Travel Desk🛄</h4><p>SQLAlchemy is one of the most widely used database libraries in Python.</p><p>Its primary goal is to provide a common interface for many different databases:</p><ul><li>Snowflake</li><li>PostgreSQL</li><li>MySQL</li><li>SQL Server</li><li>Oracle</li></ul><p>Instead of handling each database differently, SQLAlchemy provides a standardized way to interact with them:</p><pre>create_engine(...)</pre><p>Think of SQLAlchemy as the travel desk.</p><p>It understands the request and coordinates the process.</p><p>However, SQLAlchemy does not directly communicate with databases.</p><p>Just as a travel desk does not operate airplanes, SQLAlchemy does not perform the actual database communication.</p><h4>The Connector: The Airline</h4><p>Every database requires a driver or connector that understands how to communicate with it.</p><p>For Snowflake, that package is:</p><pre>snowflake-connector-python</pre><p>The connector is responsible for:</p><ul><li>Authentication</li><li>Session management</li><li>Network communication</li><li>Query execution</li><li>Retrieving results</li></ul><p>This is the component that physically communicates with Snowflake.</p><p>A useful way to think about the relationship is:</p><p>SQLAlchemy decides what needs to happen.<br>The connector knows how to make it happen.</p><p>Without the connector, Python cannot reach Snowflake.</p><p>Just as passengers cannot reach Tokyo without an airline, applications cannot reach Snowflake without a connector.</p><h4>Then why isn’t the connector enough?</h4><p>This is where things become interesting.</p><p>Consider these connection URLs:</p><pre>snowflake://...<br>postgresql://...<br>mysql://...<br>oracle://...</pre><p>When SQLAlchemy receives one of these URLs, it must determine:</p><ul><li>Which database is being used?</li><li>Which rules apply?</li><li>Which connector should be loaded?</li><li>How should SQL be generated for that database?</li></ul><p>SQLAlchemy cannot contain built-in knowledge for every database system.</p><p>Instead, it relies on specialized plugins known as dialects.</p><h4>The Dialect: The Translator</h4><p>For Snowflake, the dialect is provided by:</p><pre>snowflake-sqlalchemy</pre><p>The dialect acts as a translator between SQLAlchemy and Snowflake.</p><p>It teaches SQLAlchemy:</p><ul><li>How Snowflake connections work</li><li>How Snowflake data types should be handled</li><li>How Snowflake-specific SQL should be generated</li><li>Which connector should be used underneath</li></ul><p>Without the dialect, SQLAlchemy sees:</p><pre>snowflake://</pre><p>but has no understanding of what Snowflake is or how it should behave.</p><p>In the airport analogy, this is similar to knowing the destination is Tokyo but having no information about airlines, routes, airports, or travel rules.</p><p>The destination is known.</p><p>The path is not.</p><h4>Lets see what happens during a connection🤓</h4><p>When a Snowflake connection is created, several steps occur behind the scenes.</p><h4>Step 1: SQLAlchemy Reads the Connection URL</h4><p>SQLAlchemy examines:</p><pre>snowflake://...</pre><p>and determines that the target database is Snowflake.</p><h4>Step 2: SQLAlchemy Loads the Dialect</h4><p>The Snowflake dialect is loaded from:</p><pre>snowflake-sqlalchemy</pre><p>The dialect provides the Snowflake-specific knowledge SQLAlchemy needs.</p><h4>Step 3: The Dialect Loads the Connector</h4><p>The dialect then relies on:</p><pre>snowflake-connector-python</pre><p>to establish the actual connection.</p><h4>Step 4: The Connector Communicates with Snowflake</h4><p>The connector:</p><ul><li>Authenticates the user</li><li>Creates a session</li><li>Sends SQL queries</li><li>Receives results</li></ul><h4>Step 5: Results Return to the Application</h4><p>The response travels back through the connector, through the dialect, through SQLAlchemy, and finally into the Python application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5jq4bkrPCqPSlF4w3_mGFQ.png" /></figure><p>The next time you connect to Snowflake — or any database — remember the airport story:✈️</p><ul><li>SQLAlchemy is the travel desk.</li><li>The dialect is the route expert and translator.</li><li>The connector is the airline.</li><li>The database is the destination.</li></ul><p>A successful connection isn’t the work of one package. It’s the result of several layers working together, each solving a different problem.</p><p>Understanding those layers doesn’t just help fix errors — it helps build a deeper understanding of how modern data applications communicate with the systems they depend on.<br>Happy Learning 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a8f10a935df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parquet vs. Delta Lake: Why Modern Data Engineering Prefer Delta Lake]]></title>
            <link>https://medium.com/@syat5432/parquet-vs-delta-lake-why-modern-data-engineering-prefer-delta-lake-40c36159803f?source=rss-69600d5088a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/40c36159803f</guid>
            <category><![CDATA[parquet]]></category>
            <category><![CDATA[delta-lake]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[FishersOfData]]></dc:creator>
            <pubDate>Sat, 04 Jul 2026 17:45:43 GMT</pubDate>
            <atom:updated>2026-07-04T17:45:43.887Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7DcZXGe5uBs3cu-MOqqBOA.png" /></figure><p>If you are building data pipelines, you will inevitably choose between <strong>Parquet</strong> and <strong>Delta Lake</strong>. The foundational difference is simple: <strong>Parquet is an optimized file format, whereas Delta Lake is a transactional storage layer built on top of Parquet</strong>.</p><p>A good file comparison to keep in mind:</p><ul><li><strong>With Parquet</strong>, a table is just a directory of raw columnar files (part-001.parquet).</li><li><strong>With Delta Lake</strong>, that same directory contains the Parquet files <em>plus</em> a transaction log folder (_delta_log/000000.json). This small log completely changes how data is managed.</li></ul><p>Imagine you manage a health-tech data pipeline receiving <strong>5 million patient vital signs daily</strong> to power real-time doctor dashboards.</p><p>Initially, you save this data in plain Parquet. Because Parquet is a <strong>columnar storage format</strong>, it compresses heavily and runs analytical queries incredibly fast. If a doctor queries only oxygen levels (SELECT oxygen FROM vitals), the engine reads that single column from disk and skips the rest.</p><h3>The Problem: Parquet is Immutable</h3><p>A hospital calls with an emergency: <em>“Patient 102’s oxygen level was accidentally entered as 97. It must be updated to 99.”</em></p><p>Because <strong>Parquet files are immutable</strong>, they cannot be edited in place. To change that single row, your system must read the entire massive file into memory, modify the row, rewrite a brand-new Parquet file, and replace the old one. At corporate scale (like modifying one customer address out of 200 million rows), this is slow, expensive, and risks data corruption if another pipeline writes to that folder at the same time.</p><h3>How Delta Lake Solves This Behind the Scenes</h3><p>Delta Lake allows you to run native database commands directly on your data lake:</p><p>SQL</p><pre>UPDATE patient_vitals SET oxygen = 99 WHERE patient_id = 102;</pre><h3>What Actually Happens Internally?</h3><p>Delta Lake <strong>never</strong> modifies the original Parquet files. Instead, it uses a Git-like commit architecture:</p><pre>User runs UPDATE ➔ Reads old Parquet file ➔ Creates new Parquet file with change ➔ Writes to _delta_log (REMOVE old, ADD new)</pre><ul><li><strong>Read &amp; Copy:</strong> Delta copies the original file (part-001.parquet) and writes a brand-new file (part-002.parquet) containing the updated oxygen value (99).</li><li><strong>Commit to Log:</strong> It adds a JSON entry (000001.json) to the _delta_log directory that states: <em>Ignore </em><em>part-001.parquet, read </em><em>part-002.parquet instead.</em></li></ul><p>Because the old file is never touched, dashboards reading the data mid-update experience zero downtime or corruption. Once the log atomically commits, new queries instantly switch to the new file. This ensures full <strong>ACID transaction</strong> reliability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*76619v5xz-Z2oq4UPaoZfA.png" /></figure><h3>Two Superpowers Every Data Engineer Uses</h3><h3>1. Native Upserts (MERGE)</h3><p>When daily customer updates arrive, you must update existing records and insert new ones. Parquet requires hundreds of lines of fragile custom code to join and re-write datasets. Delta handles it natively in one statement:</p><p>SQL</p><pre>MERGE INTO customers target<br>USING updates source<br>ON target.id = source.id<br>WHEN MATCHED THEN UPDATE SET *<br>WHEN NOT MATCHED THEN INSERT *;</pre><h3>2. Time Travel</h3><p>Because Delta retains old Parquet files until you clear them, you can query exactly what the data looked like in the past:</p><p>SQL</p><pre>SELECT * FROM patient_vitals VERSION AS OF 5;</pre><p>If a buggy deployment accidentally ruins a table, you can immediately recover using RESTORE TABLE patient_vitals TO VERSION AS OF 5;.</p><h3>The Verdict: When to Use Which?</h3><ul><li><strong>Use Parquet when:</strong> Your data is strictly static and read-only, you are cold-archiving logs, or you are exporting data snapshots to external tools.</li><li><strong>Use Delta Lake when:</strong> You are building production ETL pipelines, streaming incremental data, handling changing operational states (like E-commerce orders or ride-share statuses), or requiring transactional safety.</li></ul><p><em>Which of these two formats are you currently using for your data lake pipelines?</em></p><p>Happy Learning!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40c36159803f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What happens internally when you run a Spark Submit command?]]></title>
            <link>https://medium.com/@syat5432/what-happens-internally-when-you-run-a-spark-submit-command-750dac81447a?source=rss-69600d5088a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/750dac81447a</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[pyspark]]></category>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[apache-spark]]></category>
            <dc:creator><![CDATA[FishersOfData]]></dc:creator>
            <pubDate>Sat, 30 May 2026 14:45:43 GMT</pubDate>
            <atom:updated>2026-05-30T14:45:43.243Z</atom:updated>
            <content:encoded><![CDATA[<p>Lets dive right into it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eI9vNgfEonNItNLkK99DEA.png" /></figure><p>Submitting a Spark job with spark-submit is like launching a rocket. You write your code, press the button, and Spark takes over — but under the hood, a fascinating sequence unfolds.</p><h3>1) Client Submits the Job</h3><p>When you run:</p><p>bash: spark-submit my_app.py</p><ul><li>The <strong>Spark client</strong> packages your application code, dependencies, and configuration.</li><li>It sends this bundle to the <strong>cluster manager</strong> (YARN, Mesos, or Spark’s own Standalone manager).</li></ul><h3>2) Driver Starts</h3><ul><li>The <strong>Driver Program</strong> is launched.</li><li>The driver is the “brain” of your Spark job — it coordinates tasks, maintains metadata, and interacts with the cluster.</li></ul><h3>3) Code Translates into a Logical Plan</h3><p>When your Spark code runs (e.g., DataFrame or SQL queries), Spark doesn’t immediately execute it. Instead, it builds a <strong>Logical Plan</strong> — a tree of operations like select, filter, join.</p><ul><li>At first, this is an <strong>Unresolved Logical Plan</strong>:</li><li>Column names, table references, and functions are not yet checked.</li><li>Example: &quot;age&quot; is just a string, not yet tied to a real column.</li></ul><h3>4) Catalyst Analyzer Resolves the Plan</h3><p>Enter <strong>Catalyst Analyzer</strong>:</p><ul><li>It looks at the catalog (metadata of tables, schemas, functions).</li><li>It resolves &quot;age&quot; into age#12 (a specific column ID).</li><li>It ensures functions and references are valid.</li></ul><p>After this step, you have a <strong>Resolved Logical Plan</strong>.</p><h3>5) Catalyst Optimizer Improves the Plan</h3><p>Now the <strong>Catalyst Optimizer</strong> takes over:</p><ul><li>It applies <strong>rule-based optimizations</strong>:</li><li>Predicate pushdown (apply filters early).</li><li>Constant folding (simplify expressions).</li><li>Projection pruning (drop unused columns).</li><li>It may also apply <strong>cost-based optimizations</strong> if statistics are available.</li></ul><p>The result is an <strong>Optimized Logical Plan</strong>.</p><h3>6) Physical Plan is Generated</h3><ul><li>Spark translates the optimized logical plan into one or more <strong>Physical Plans</strong>.</li><li>Each physical plan describes <em>how</em> the job will actually run on the cluster.</li><li>Spark chooses the best plan based on cost and efficiency.</li></ul><h3>7) Tasks are Sent to Executors</h3><ul><li>The driver sends tasks to <strong>executors</strong> (worker processes).</li><li>Executors run the tasks on partitions of data in parallel.</li><li>Results are sent back to the driver.</li></ul><h3>8) Execution &amp; Results</h3><p>Finally, the job executes:</p><ul><li>Data is read, transformed, and written out.</li><li>The driver collects results or writes them to storage.</li></ul><h3>🚨 What is Catalyst?</h3><p>Catalyst is Spark SQL’s <strong>query optimization engine</strong>. It has two main roles:</p><ul><li><strong>Analyzer</strong> → resolves references in the logical plan.</li><li><strong>Optimizer</strong> → improves the plan using rules and strategies.</li></ul><p>Together, they ensure your query is both <strong>valid</strong> and <strong>efficient</strong> before execution.</p><h3>Example Walkthrough</h3><p>python</p><pre>df = spark.read.csv(&quot;people.csv&quot;, header=True)<br>result = df.select(&quot;name&quot;).filter(df.age &gt; 30)</pre><ul><li><strong>Unresolved Logical Plan</strong>:</li><li>Project [UnresolvedAttribute(name)]</li><li>Filter (UnresolvedAttribute(age) &gt; 30)</li><li><strong>Analyzer</strong>: Resolves attributes →</li><li>Project [name#0]</li><li>Filter (age#1 &gt; 30)</li><li><strong>Optimizer</strong>: Pushes filter down →</li><li>Only rows with age &gt; 30 are read from disk.</li><li><strong>Physical Plan</strong>: Executes scan + filter across partitions.</li></ul><h3>🐾Takeaway</h3><p>After spark-submit:</p><ol><li><strong>Client Submission</strong> → Packages your app and sends it to the cluster manager.</li><li><strong>Driver Launch</strong> → Driver program starts, orchestrating the job.</li><li><strong>Unresolved Logical Plan</strong> → Spark parses your DataFrame/SQL code into a draft plan (column names, functions not yet validated).</li><li><strong>Catalyst Analyzer</strong> → Resolves references using the catalog (maps &quot;age&quot; to actual column age#12).</li><li><strong>Catalyst Optimizer</strong> → Applies rule-based optimizations (predicate pushdown, projection pruning, constant folding).</li><li><strong>Physical Plan</strong> → Chooses the best execution strategy.</li><li><strong>Execution</strong> → Tasks distributed to executors, results collected.</li></ol><p>Happy Learning!😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=750dac81447a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[APACHE SPARK MEMORY MANAGEMENT]]></title>
            <link>https://medium.com/@syat5432/apache-spark-memory-management-19927f7cfe0f?source=rss-69600d5088a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/19927f7cfe0f</guid>
            <category><![CDATA[apache-spark]]></category>
            <category><![CDATA[memory-management]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[FishersOfData]]></dc:creator>
            <pubDate>Sun, 24 May 2026 18:19:29 GMT</pubDate>
            <atom:updated>2026-05-25T17:08:00.659Z</atom:updated>
            <content:encoded><![CDATA[<h3>SPARK MEMORY MANAGEMENT</h3><p>As a Data Engineer, have you ever wondered how spark memory allocation and execution works. Many engineers treat Apache Spark like a black box: write PySpark code, cross fingers, and hit deploy. But when data scales to terabytes, “hope” isn’t a strategy.</p><p>Understanding how Spark allocates memory and executes code under the hood isn’t just academic theory — it’s the exact boundary that separates a script writer from a world-class Data Engineer. Master these mechanics, and gain the superpower to slash cloud costs, eliminate cryptic OOM errors, and build lightning-fast pipelines that scale seamlessly.</p><p>Let’s crack open the black box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QBuMbIke9PoiMK_ExmcOzw.png" /></figure><p>Spark Executor- a worker process on a cluster node that is responsible for running the actual data processing tasks assigned by the Driver.</p><p><strong>Physical Location (Where the memory physically sits)</strong></p><p><em>“Is this memory managed inside or outside the Java Virtual Machine (JVM)?”</em></p><p>There are only two physical locations:</p><ul><li><em>On-Heap (Inside the JVM)</em><strong>:</strong> The memory sits within the standard Java Virtual Machine execution space. It is managed by the automated Java Garbage Collector (GC). Data is stored as standard, bulky Java objects.</li><li><em>Off-Heap (Outside the JVM)</em><strong>:</strong> The memory sits in the raw, native RAM of the operating system. It completely bypasses the JVM. Data is managed directly by Spark’s Project Tungsten as highly compacted, raw binary byte streams, meaning the Java GC doesn’t even know it exists (eliminating GC pauses).</li></ul><p><strong>Functional Pool (What the memory is being used for)</strong></p><p><em>“What kind of task is this memory currently assigned to?”</em></p><ul><li><strong>User Pool:</strong> Managed by the developer’s code. Cannot spill to disk. Overloading it causes an immediate crash.</li><li><strong>Execution Pool:</strong> Managed by Spark for active processing (joins/shuffles). High priority. Spills to disk if full.</li><li><strong>Storage Pool:</strong> Managed by Spark for caching. Low priority. Uses LRU eviction to clear space if full.</li></ul><p>Execution Pool and the Storage Pool are lumped together into one giant pool called Unified Memory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TmiJhpZ4S0dSxPIqTIeBnQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19927f7cfe0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL question asked in Adobe and Uber (Leetcode level Hard) ▶️]]></title>
            <link>https://medium.com/@syat5432/sql-question-asked-in-adobe-and-uber-leetcode-level-hard-%EF%B8%8F-27af9abdb9fd?source=rss-69600d5088a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/27af9abdb9fd</guid>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[uber]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[adobe]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[FishersOfData]]></dc:creator>
            <pubDate>Sat, 07 Jun 2025 16:26:16 GMT</pubDate>
            <atom:updated>2025-06-07T16:26:16.914Z</atom:updated>
            <content:encoded><![CDATA[<h3>“ Human Traffic of Stadium”</h3><h4>The stadium management team wants to identify periods of high attendance. Specifically, they are interested in finding periods of 3 or more consecutive days where the number of people is at least 100 each day. These periods help them analyze high-demand events or promotional success.</h4><h4>Write a SQL query to find all records from the stadium table that are part of 3 or more consecutive days where the no_of_people was 100 or more each day.</h4><h4>The output should include the id, visit_date, and no_of_people of only those rows that are part of such sequences.</h4><p>create table stadium (<br>id int,<br>visit_date date,<br>no_of_people int<br>);</p><p>insert into stadium<br>values (1,&#39;2017-07-01&#39;,10)<br>,(2,&#39;2017-07-02&#39;,109)<br>,(3,&#39;2017-07-03&#39;,150)<br>,(4,&#39;2017-07-04&#39;,99)<br>,(5,&#39;2017-07-05&#39;,145)<br>,(6,&#39;2017-07-06&#39;,1455)<br>,(7,&#39;2017-07-07&#39;,199)<br>,(8,&#39;2017-07-08&#39;,188);</p><p>✅ SOLUTION<br>WITH groupings AS(<br>SELECT *,ROW_NUMBER() OVER(ORDER BY id) as rn,<br>id-ROW_NUMBER() OVER(ORDER BY id) as grp<br>FROM stadium WHERE<br>no_of_people&gt;=100<br>)<br>SELECT id,visit_date,no_of_people FROM groupings WHERE grp IN<br>(SELECT grp FROM groupings GROUP BY grp HAVING COUNT(1)&gt;=3) ;</p><p>🟩 Explanation<br>ROW_NUMBER() OVER (ORDER BY id) assigns a unique row number (rn) to each row where no_of_people &gt;= 100.<br>The difference between the id and the row_number is calculated as grp.<br>🧠 Key Trick: For consecutive rows (with no gaps in id), the difference<br> id - row_number will be constant.<br>This trick groups consecutive valid rows (with no_of_people &gt;= 100) under the same grp value.<br>Finally GROUP BY grp groups together rows that belong to the same consecutive sequence.<br>HAVING COUNT(1) &gt;= 3 keeps only those groups with 3 or more rows.<br>The outer query returns the full rows of those qualifying sequences.</p><h4>#ProblemSolving #DataEngineering #DataScientist #DataAnalyst #Adobe #Uber #Sql</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27af9abdb9fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>