P21PandasAdvancedDiagnose16 min

Diagnose Unexpected Results After a Merge

Investigate why a customer-order merge suddenly produces far more rows than either input.

#merge#duplicates#cardinality#data-quality

Scenario

A merge of 10,000 customers and 45,000 orders produces 210,000 rows, inflating revenue totals.

Problem statement

Explain the likely cause and show how to validate the intended merge cardinality.

Your Task

  1. Inspect duplicate keys in both inputs.
  2. State the expected relationship.
  3. Use merge validation to fail early when it is violated.

Related Concepts

Merge validationMany-to-many joinsData contracts

Ready to count this problem?

Mark it complete when you have reasoned through the solution in your own words.