The order was counted twice. Duplicate records in Databricks, explained

Where duplicates come from, why DISTINCT is not a strategy, and the three questions to answer first