cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Forum Posts

dataumer
by • New Contributor
  • 133 Views
  • 4 replies
  • 5 kudos

Resolved! Why does running OPTIMIZE not always improve Delta table performance?

After running OPTIMIZE on a large Delta table, the number of files may reduce significantly, but the actual query execution time does not improve much.What could be the reason for this?How do we determine whether the performance issue is related to f...

  • 133 Views
  • 4 replies
  • 5 kudos
Latest Reply
tajamulkhan
Honored Contributor III
  • 5 kudos

HelloOPTIMIZE primarily improves the physical layout of a Delta table by compacting small files. However, reducing the number of files does not necessarily reduce the amount of data processed by a query.I would investigate the following.1. Compare ta...

  • 5 kudos
3 More Replies
dataumer
by • New Contributor
  • 98 Views
  • 3 replies
  • 7 kudos

Resolved! Delta table history is available but time travel is not working

Why can DESCRIBE HISTORY show older versions of a Delta table even when querying those versions fails after running VACUUM?Is there any possibility of recovering an older version if the corresponding data files have already been deleted?Also, what re...

  • 98 Views
  • 3 replies
  • 7 kudos
Latest Reply
tajamulkhan
Honored Contributor III
  • 7 kudos

HiThis happens because Delta Lake transaction history and historical data files have separate retention policies.DESCRIBE HISTORY reads transaction log information, while time travel requires both the relevant transaction log and the underlying histo...

  • 7 kudos
2 More Replies
dataumer
by • New Contributor
  • 124 Views
  • 3 replies
  • 3 kudos

Resolved! Handling concurrent MERGE operations on the same Delta table

How do you handle situations where multiple Databricks jobs need to update the same Delta table at the same time?Even when the jobs are updating different sets of records, concurrent modification errors can still occur.Can row-level concurrency compl...

  • 124 Views
  • 3 replies
  • 3 kudos
Latest Reply
tajamulkhan
Honored Contributor III
  • 3 kudos

HiDelta Lake uses optimistic concurrency control, so concurrent MERGE operations can conflict even when they update different records, particularly when those records reside in the same underlying data files.Row-level concurrency significantly reduce...

  • 3 kudos
2 More Replies
dataumer
by • New Contributor
  • 119 Views
  • 3 replies
  • 3 kudos

Resolved! How to prevent duplicate records when using MERGE INTO?

hello guysWhat is the best way to handle a source dataset that contains multiple records for the same business key before performing a MERGE into a Delta table?For example, the same customer ID may appear multiple times with different update timestam...

  • 119 Views
  • 3 replies
  • 3 kudos
Latest Reply
tajamulkhan
Honored Contributor III
  • 3 kudos

HelloYes, ROW_NUMBER() is a good approach, but the important part is making the deduplication deterministic.Delta MERGE does not automatically deduplicate source records. Multiple source records matching the same target record can cause ambiguous upd...

  • 3 kudos
2 More Replies
dataumer
by • New Contributor
  • 131 Views
  • 3 replies
  • 3 kudos

Resolved! Delta MERGE becomes slower even with a small incremental dataset

helloSuppose we have a Delta table with around 500 million records and receive only 10,000 new or updated records every day.Why does the MERGE operation become increasingly slower as the target table grows, even though the incremental data volume rem...

  • 131 Views
  • 3 replies
  • 3 kudos
Latest Reply
tajamulkhan
Honored Contributor III
  • 3 kudos

Hi UmerYes, this can happen because MERGE performance depends not only on the incoming data volume but also on how efficiently Databricks identifies and modifies the matching target files.Even with only 10,000 incoming records, a poorly optimized MER...

  • 3 kudos
2 More Replies
a_user12
by • Contributor
  • 27 Views
  • 0 replies
  • 0 kudos

Manage Project Dependencies with pyproject.toml

Dear Community!I want to work in a serverless environment. I tried this code here a couple of weeks:resources: pipelines: test_uv_etl: name: test_uv_etl catalog: ${var.catalog} schema: ${var.schema} serverless: true ...

  • 27 Views
  • 0 replies
  • 0 kudos
tajamulkhan
by • Honored Contributor III
  • 205 Views
  • 3 replies
  • 6 kudos

Can AI Agents Safely Fix Production Data Pipelines?

AI agents are increasingly being used to investigate data pipeline failures and recommend corrective actions.With capabilities like Genie ZeroOps, an interesting question is how much autonomy we should give AI agents in production environments.Consid...

  • 205 Views
  • 3 replies
  • 6 kudos
Latest Reply
balajij8
Esteemed Contributor III
  • 6 kudos

Draw a line at anything that changes data semantics - automated detection and diagnosis , Reversible recovery actions automated, and require human approval for the remaining. AI agent can monitor pipelines, surface root causes and propose fixes (sour...

  • 6 kudos
2 More Replies
arun07
by • New Contributor
  • 249 Views
  • 3 replies
  • 2 kudos

One metadata-driven pipeline for ~50 database sources (~100 tables each), ~50 REST APIs and files

Hi all,We're designing ingestion into Databricks and want honest, critical feedback from people who've run something similar at scale.The approachEverything is read from control tables, and extraction runs dynamically for each metadata row. There is ...

  • 249 Views
  • 3 replies
  • 2 kudos
Latest Reply
balajij8
Esteemed Contributor III
  • 2 kudos

Scale orchestration - The pattern is appropriate but breaks in few places, none of which is due to Spark compute - a single pipeline run serializes extractions behind one driver, so run it as one orchestrating job with a For each task and a concurren...

  • 2 kudos
2 More Replies
rajkumar8k
by • Contributor
  • 47 Views
  • 0 replies
  • 0 kudos

Lakebridge: More Than a Migration Tool

The Real Problem It Was Built to SolveWhen Databricks introduced Lakebridge, many people saw it as another migration utility, a way to move workloads from traditional data warehouses into the Databricks ecosystem. That description is technically corr...

  • 47 Views
  • 0 replies
  • 0 kudos
alondatamvp
by • New Contributor
  • 101 Views
  • 2 replies
  • 2 kudos

Resolved! How to avoid duplicate records when repairing failed Databricks Jobs?

Suppose a job task successfully writes records to a Delta table but fails while performing a subsequent operation.When we repair the job, the failed task executes again and potentially inserts the same records.How do you normally handle such situatio...

  • 101 Views
  • 2 replies
  • 2 kudos
Latest Reply
balajij8
Esteemed Contributor III
  • 2 kudos

It happens because a job task isn't a transaction boundary - it's just a container of code. When a task writes to a Delta table and then fails on a later operation (API call, notify step), the write has already committed as a Delta version and the ta...

  • 2 kudos
1 More Replies
fatimak01
by • New Contributor
  • 146 Views
  • 3 replies
  • 4 kudos

Resolved! Spark job stuck at 99% for a long time

Hi EveryoneWhy do some Spark jobs complete almost all their tasks within a few minutes, but the last two or three tasks take significantly longer?Even with adaptive query execution enabled, this can become a bottleneck. How do you normally troublesho...

  • 146 Views
  • 3 replies
  • 4 kudos
Latest Reply
balajij8
Esteemed Contributor III
  • 4 kudos

@fatimak01 What you are seeing is generally data skew - one or a few keys hold a disproportionate share of the rows, so after a shuffle (join or groupBy), couple of partitions end up carrying most of the data while hundreds of activities finish in mi...

  • 4 kudos
2 More Replies
fatimak01
by • New Contributor
  • 138 Views
  • 3 replies
  • 4 kudos

Resolved! PySpark DataFrame works with display() but fails while writing to Delta

Why does a DataFrame sometimes work perfectly with display(), but the same DataFrame throws an OutOfMemoryError when writing to a Delta table?The DataFrame contains multiple joins and aggregations. Increasing the number of workers does not always sol...

  • 138 Views
  • 3 replies
  • 4 kudos
Latest Reply
balajij8
Esteemed Contributor III
  • 4 kudos

Display only materializes a preview of the DataFrame (table results are capped at a limit and size), so Spark executes just enough of the plan to fill that window, while the full DAG of joins, aggregations and shuffles stays lazily deferred. Write fo...

  • 4 kudos
2 More Replies
fatimak01
by • New Contributor
  • 156 Views
  • 3 replies
  • 3 kudos

Resolved! Increasing the number of workers makes Spark jobs slower

HelloIs it normal for a Spark job to take longer after increasing the number of workers?For workloads involving multiple joins and aggregations, adding more workers does not always seem to improve performance.How do you determine the right cluster si...

  • 156 Views
  • 3 replies
  • 3 kudos
Latest Reply
balajij8
Esteemed Contributor III
  • 3 kudos

@fatimak01 Adding workers only helps while there are enough activities to spread across them. Three things break that -parallelism ceiling - extra workers sit idle while fixed overheads (scheduling, shuffle block fetches, cloud storage client content...

  • 3 kudos
2 More Replies
fatimak01
by • New Contributor
  • 119 Views
  • 3 replies
  • 2 kudos

Resolved! When should we avoid caching DataFrames in Databricks?

Caching is generally recommended when we reuse a DataFrame multiple times. However, there seem to be situations where caching actually increases the execution time.How do we identify whether a DataFrame is worth caching?Also, what happens when the ca...

  • 119 Views
  • 3 replies
  • 2 kudos
Latest Reply
saisaranv
Valued Contributor II
  • 2 kudos

Just adding a note which might help you :Previously, for most of the ML workloads, teams heavily relied on caching DataFrames to avoid recomputation during multiple validation and transformation steps. However, with advancements in Spark optimization...

  • 2 kudos
2 More Replies
Labels