<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/delta-lake-upsert-x7bfzicld" -->

---
title: Delta Lake Upsert | daily.dev
description: Delta Lake enables upsert operations (insert, update, delete in one pass) without rewriting entire datasets, using the MERGE command. A benchmark comparing...
canonical: https://daily.dev/posts/delta-lake-upsert-x7bfzicld
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Delta Lake Upsert | daily.dev
og:description: Delta Lake enables upsert operations (insert, update, delete in one pass) without rewriting entire datasets, using the MERGE command. A benchmark comparing...
og:url: https://daily.dev/posts/delta-lake-upsert-x7bfzicld
og:image: https://api.daily.dev/og/posts/X7BFzIClD.png
og:image:alt: Delta Lake Upsert
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Delta Lake Upsert

**[Delta Lake Blog](https://daily.dev/sources/delta-lake)** · 7 min read · 0 upvotes · 0 comments

## Summary

Delta Lake enables upsert operations (insert, update, delete in one pass) without rewriting entire datasets, using the MERGE command. A benchmark comparing Parquet vs Delta Lake on a 53-million-row dataset shows Parquet requires rewriting the whole file (28+ seconds) while Delta Lake completes the same operation much faster by recording the change in its transaction log. The piece walks through defining a target Delta table, creating a source DataFrame, running MERGE, verifying results, and using time travel to inspect previous versions. It also covers custom MERGE conditions, performing upserts without Spark using delta-rs (the Rust implementation), and best practices like optimizing tables, Z-Ordering, Liquid Clustering, and using primary keys in merge conditions.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://delta.io/blog/delta-lake-upsert>

## Questions this post answers

### How do I perform an upsert in Delta Lake without using Spark?

Use delta-rs, the Rust implementation of Delta Lake, which supports non-Spark engines like PyArrow, pandas, Polars, and Daft. Delta-rs lets you run MERGE-style upsert operations directly against a Delta table without any Spark dependencies, making it useful for lighter-weight or non-JVM data pipelines.

_Explore daily.dev for more ways developers run Delta Lake without a Spark cluster._

### Why is upserting into a Delta Lake table faster than upserting into Parquet files?

Delta Lake registers an upsert as a small change to its transaction log instead of rewriting the entire dataset, while Parquet's immutability forces a full rewrite of all rows. In a benchmark on a 53-million-row dataset, rewriting Parquet took more than 28 seconds on an 8-core M1 MacBook Pro, whereas the equivalent Delta Lake MERGE completed much faster and avoided duplicating files on disk.

_Developers weighing storage formats can compare upsert performance trade-offs on daily.dev._

### What does the MERGE command in Delta Lake do?

The MERGE command combines insert, update, and delete actions into a single query, matching rows between a target table and a source table using a join condition. Clauses like whenMatchedUpdate handle existing rows that match, while whenNotMatchedInsert adds rows from the source that have no match in the target, enabling a full upsert in one operation.

_daily.dev helps engineers dig deeper into MERGE syntax when building upsert pipelines._

## Similar posts on daily.dev

- [Delta Lake Explained: Boost Data Reliability in Cloud Storage](https://daily.dev/posts/delta-lake-explained-boost-data-reliability-in-cloud-storage-oechbmvm4) · databricks · 0 upvotes · 0 comments
- [Apache Iceberg vs Delta Lake: Choosing the Right Table Format](https://daily.dev/posts/apache-iceberg-vs-delta-lake-choosing-the-right-table-format-vtnia2ems) · BigData Boutique blog · 7 upvotes · 0 comments

---

Tags: [#backend](https://daily.dev/tags/backend), [#rust](https://daily.dev/tags/rust), [#data-engineering](https://daily.dev/tags/data-engineering), [#apache-spark](https://daily.dev/tags/apache-spark)

[View this post on daily.dev](https://daily.dev/posts/delta-lake-upsert-x7bfzicld)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Delta Lake Upsert","url":"https://daily.dev/posts/delta-lake-upsert-x7bfzicld","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/delta-lake-upsert-x7bfzicld"},"datePublished":"2026-08-16T08:53:51.029Z","dateModified":"2026-08-16T08:57:28.146Z","description":"Delta Lake enables upsert operations (insert, update, delete in one pass) without rewriting entire datasets, using the MERGE command. A benchmark comparing...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/92580387955c1233aa7bd4661f0a1c2e?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/92580387955c1233aa7bd4661f0a1c2e?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Delta Lake Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Delta Lake Blog","logo":"https://media.daily.dev/image/upload/s--7f2q9Asf--/f_auto,q_auto/v1786870393/logos/delta-lake?_a=BAMAMicg0","url":"https://daily.dev/sources/delta-lake"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/delta-lake-upsert-x7bfzicld","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"backend,rust,data-engineering,apache-spark","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Delta Lake Blog","item":"https://daily.dev/sources/delta-lake"},{"@type":"ListItem","position":3,"name":"Delta Lake Upsert"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/delta-lake-upsert-x7bfzicld#faq","mainEntity":[{"@type":"Question","name":"How do I perform an upsert in Delta Lake without using Spark?","acceptedAnswer":{"@type":"Answer","text":"Use delta-rs, the Rust implementation of Delta Lake, which supports non-Spark engines like PyArrow, pandas, Polars, and Daft. Delta-rs lets you run MERGE-style upsert operations directly against a Delta table without any Spark dependencies, making it useful for lighter-weight or non-JVM data pipelines. Explore daily.dev for more ways developers run Delta Lake without a Spark cluster."}},{"@type":"Question","name":"Why is upserting into a Delta Lake table faster than upserting into Parquet files?","acceptedAnswer":{"@type":"Answer","text":"Delta Lake registers an upsert as a small change to its transaction log instead of rewriting the entire dataset, while Parquet's immutability forces a full rewrite of all rows. In a benchmark on a 53-million-row dataset, rewriting Parquet took more than 28 seconds on an 8-core M1 MacBook Pro, whereas the equivalent Delta Lake MERGE completed much faster and avoided duplicating files on disk. Developers weighing storage formats can compare upsert performance trade-offs on daily.dev."}},{"@type":"Question","name":"What does the MERGE command in Delta Lake do?","acceptedAnswer":{"@type":"Answer","text":"The MERGE command combines insert, update, and delete actions into a single query, matching rows between a target table and a source table using a join condition. Clauses like whenMatchedUpdate handle existing rows that match, while whenNotMatchedInsert adds rows from the source that have no match in the target, enabling a full upsert in one operation. daily.dev helps engineers dig deeper into MERGE syntax when building upsert pipelines."}}]}
```

