Skip to content

routier-collection


routier-collection / core/src / hashJoin

Function: hashJoin()

hashJoin(options): JoinTuple[]

Defined in: core/src/plugins/query/join.ts:177

The join itself: one hash join, written once, called from every interpreter.

O(n + m) rather than a nested loop, which is the whole reason the API takes explicit key selectors instead of a free-form predicate. Both key properties are string or number by a build-time rule, so the keys are hashable and compare the same way in JS and in SQL.

Semantics, exactly as specs/joins.md states them:

  • Null keys never match. Under left the outer row still appears, paired with undefined.
  • Duplicates produce every pair: the full cross product per key group.
  • Ordering is outer order, then inner order within a key group. Undefined by contract — a caller who cares sorts.

Parameters

options

kind

JoinKind

outerRows

UnknownRecord[]

innerRows

UnknownRecord[]

outerKey

JoinKeyReference

innerKey

JoinKeyReference

Returns

JoinTuple[]

Released under the MIT License.