Loading section...

Hash Join in Python — Implementing the Core Query Primitive

At the mid-level, DE interviews often ask you to implement a join without pandas or SQL. 'Given two lists of records sharing a common key, implement an inner join.' The expected approach is a hash join — build a dict from the smaller table, probe with the larger table. This is literally what database engines do internally when they choose a hash join over a sort-merge join. When to Hash Join vs When to Use pandas