Why AQE Coalesces Shuffle Partitions (and When It Can't Help)
How Adaptive Query Execution merges small shuffle partitions at runtime, the settings that control it, and the cases where you still have to tune.
Topic
Workspaces, clusters, jobs, Unity Catalog and running Spark workloads well.
How Adaptive Query Execution merges small shuffle partitions at runtime, the settings that control it, and the cases where you still have to tune.
Both load files into Delta exactly once. The choice comes down to file volume over the table's lifetime, who maintains the pipeline, and how often you need to reload a subset.
One databricks.yml, three environments, zero clicking. Bundle structure, targets and modes, variables, and a promotion pipeline that deploys as a service principal.
The three settings that decide whether Auto Loader is cheap and boring or expensive and surprising — file discovery mode, schema evolution mode, and what actually lives in the checkpoint.
Which trigger mode to pick and what it costs, what actually lives in a checkpoint, and the three conditions exactly-once depends on — one of which is your code.
Warn, drop or fail — the three expectation actions, the quarantine pattern that's better than all of them, and how to keep quality rules out of your pipeline code.
A CDC feed sends duplicates and out-of-order changes. Build a MERGE that keeps the latest row per key, ignores late events and is safe to replay.
Enable Change Data Feed and read row-level inserts, updates and deletes by version to refresh downstream Delta tables incrementally.
When to use a shallow clone, a deep clone or RESTORE: test on real data, take real backups, and roll back bad writes safely.
Deletion vectors mark rows instead of rewriting files; row tracking gives rows stable IDs. How both work, what they cost, and how to purge.
Identity keys, computed columns and defaults in Delta: what each guarantees, what it doesn't, and the concurrency trade-off that bites.
25 scenario-based Delta Lake interview questions in five areas, with what the interviewer is checking and a strong answer for each.
The five Delta MERGE patterns (upsert, insert-only, newer-wins, deletes, full sync), the errors that break them, and how to make them fast.
Query old Delta versions, compare them, recover from a bad write, and set retention correctly now that Runtime 18 changed the rules.
OPTIMIZE compacts, Z-ORDER sorts, VACUUM deletes. How each works, how to schedule them, and what predictive optimization and Runtime 18 changed.
Delta rejects mismatched writes by default. How to allow new columns, wider types, renames and drops on purpose, one write at a time.
Why Delta tables collect tiny files, how to measure it, and the writer fixes and compaction strategies that stop it coming back.
Read _delta_log yourself: what commits and checkpoints contain, how readers build snapshots, and how concurrent writers avoid corruption.
The three table formats now share most features. What still differs: metadata design, engine and catalog support, and write patterns.
Four names, one engine, four years. A short map of what got renamed, what got open-sourced, what your old code still does, and which word to use in an interview.
Three modeling styles, three different problems they solve. A decision framework based on source count, audit needs, team size and consumers, plus the hybrid most lakehouses end up with.
What a managed connector actually runs on your behalf — the ingestion gateway, staging and pipeline — plus when a connector beats hand-rolled CDC and when it doesn't.
Build a job graph that survives a bad night — run_if conditions for error handling, the five trigger types and their limits, and why repair runs only help idempotent tasks.
Build your first declarative pipeline end to end — streaming tables, materialized views, flows and the pipeline graph — using the pyspark.pipelines API that replaced import dlt.
Facts that show up before their customer exists, and facts that show up weeks after the event. Inferred members, point-in-time joins and re-keying jobs on Delta Lake, with the trade-offs of each.
Three ways to make Delta skip files, compared on cost and flexibility, with a decision order, migration steps and when partitioning still wins.
A field checklist for slow or expensive PySpark jobs: baseline first, then read less, shuffle less, balance the work, compute smarter, use memory well and write right.
A practical route through the Spark UI: map a slow query to its stage, read the summary metrics, and recognise skew, spill, tiny files and GC pressure.
repartition shuffles to any count with even sizes; coalesce merges without a shuffle but only downwards. When to use each, and the coalesce(1) trap.
Expire the old version and insert the new one in a single Delta MERGE. The staged-union pattern, a PySpark version, the tests that catch broken history, and when to hand it to AUTO CDC.
How each Spark join strategy moves data, the rules Spark uses to pick one, how AQE changes the choice at runtime, and when to step in with a hint.
cache and persist keep results but remember the lineage; checkpoint keeps only the result. Storage levels, when each pays off, and what to use on serverless.
Find the hot key behind a stage that never finishes, then fix it with AQE skew joins, key cleanup, hot-key isolation or salting, in that order.
How executor and driver memory is actually divided, why tasks spill, and how to diagnose and fix each kind of out-of-memory error instead of just adding RAM.
Delta tables didn't make dimensional modeling obsolete. Here's how to pick the grain, split facts from dimensions, and build a star schema on Databricks that analysts can trust.
Identity columns, hash keys and ROW_NUMBER sequences all produce surrogate keys on Delta Lake. They differ on concurrency, collisions, reproducibility and join cost. Here's how to choose.
Build bronze, silver and gold on Databricks with Auto Loader, MERGE and liquid clustering, plus the mistakes that break it in production.
How Unity Catalog organizes data on Databricks: metastore, catalogs, schemas, tables and volumes, with the SQL to set each one up.
Why MERGE quietly rewrites far more data than it changes, and the three fixes that keep it fast: prune the target, deduplicate the source, compact after.
The five levers that actually move a Databricks bill: job clusters over all-purpose, right-sized autoscaling, spot instances, photon where it pays, and killing idle time.
Delta's mergeSchema option does nothing for MERGE statements — automatic schema evolution for MERGE is a separate session setting.
A fact-to-dimension join runs on one straggler task for 40 minutes. Diagnose the skew and fix it three different ways.
Watch a bronze → silver → gold pipeline built end to end on Databricks, and learn what each layer actually promises.
See exactly which files a MERGE rewrites, then watch partition pruning cut a 300 GB rewrite down to 4 GB.
A guided tour of Unity Catalog's object model — metastore, catalogs, schemas, tables and volumes — and where permissions actually attach.
A printable checklist for designing and reviewing bronze, silver and gold layers — naming, quality gates, ownership and the questions to ask at each hop.
The governance, Delta Lake and SQL topics the Databricks Data Engineer Associate exam leans on, with practice problems for each.
Go from never having built a bronze/silver/gold pipeline to shipping one on Databricks, with a Fabric comparison and hands-on MERGE practice.