---
name: Join
lang: cpp
domain: core
version: "1.0.0"
algebraic: product
definition: |
  struct Join {
      std::string                                          alias;
      std::string                                          source;
      std::vector<std::pair<std::string, std::string>>     on;
      JoinStrategy                                         strategy;
      std::vector<std::string>                             fields;
  };
description: "Join MBQL-style entre main_t y source. on = pares {left_col, right_col} multi-key. strategy = Left/Inner/Right/Full. fields vacio = all cols del derecho."
tags: [tql, join, mbql, product-type]
uses_types: [JoinStrategy_cpp_core]
file_path: "cpp/functions/core/data_table_types.h"
---

## Notas

Materializado por `join_tables_cpp_core` antes de stages[0]. Cols del derecho se prefijan con `alias.col` para preservar headers del main. SQL emit: `LEFT/INNER/RIGHT/FULL OUTER JOIN source AS alias ON main.l = alias.r AND ...`.

Multi-key: `on = {{l1,r1}, {l2,r2}}` → `ON main.l1 = alias.r1 AND main.l2 = alias.r2`.
