Skip to main content

JOIN

Combine datasets using inner join logic - only matching rows are kept.

Syntax

JOIN fromClause [ON expression]?

Parameters

  • fromClause - Either a dataset identifier or an alias assignment (alias = dataset)
  • expression - Boolean condition defining how rows should match

Description

The JOIN command performs an inner join operation, combining the current dataset with another dataset based on matching conditions you specify in the ON clause. Only rows that have matches in both datasets appear in the final results.

The joined data is automatically nested as a struct to prevent field name collisions. By default, the struct uses the name of the joined dataset, but you can override this using the assignment syntax in the fromClause. You access fields from the joined dataset using dot notation on the struct name.

When you omit the ON clause, the join becomes a cartesian product of all rows from both datasets. The join condition expression can reference fields in the current dataset directly and fields in the joined dataset by name using dot notation (e.g., users.email).

  • LOOKUP - Left outer join that preserves all original rows