Posts

Showing posts from January, 2025

If Delta Lake Uses Immutable Files, How Do UPDATE, DELETE, and MERGE Work?

Listen and Watch here One of the most common questions data engineers ask is: if Delta Lake stores data in immutable Parquet files, how can it support operations like UPDATE , DELETE , and MERGE ? The answer lies in Delta Lake’s transaction log and its clever file rewrite mechanism. 🔍 Immutable Files in Delta Lake Delta Lake stores data in Parquet files, which are immutable by design. This immutability ensures consistency and prevents accidental corruption. But immutability doesn’t mean data can’t change — it means changes are handled by creating new versions of files rather than editing them in place. ⚡ How UPDATE Works When you run an UPDATE statement, Delta Lake: Identifies the files containing rows that match the update condition. Reads those files and applies the update logic. Writes out new Parquet files with the updated rows. Marks the old files as removed in the transaction log. UPDATE people SET age = age + 1 WHERE country = 'India'; Result: ...

Datawarehouse Vs Datalake

  Data Warehouse :   A data warehouse is a centralized repository that stores structured and processed data from various sources. It's optimized for querying and analysis, typically using a schema-on-write approach, where data is structured and organized before being loaded into the warehouse. Data warehouses are designed for supporting business intelligence (BI) and analytics applications, providing fast and reliable access to historical data. Q.  How do data lakes differ from data warehouses, and what are their primary characteristics? Unlike data warehouses, data lakes store raw, unstructured, or semi-structured data in its native format. They use a schema-on-read approach, where data is ingested without prior structuring, allowing for flexible exploration and analysis.  Data lakes are designed to store vast amounts of data at a low cost and support a wide range of data processing and analytics use cases, including data exploration, machine learning, and advanced...