yobx.sql.ops — join_op module#
ONNX converter for JoinOp (SQL JOIN clause).
- yobx.sql.ops.join_op.convert_join_op(g: GraphBuilder, sts: Dict | None, outputs: List[str], op: JoinOp, col_map: Dict[str, str], right_col_map: Dict[str, str]) Dict[str, str][source]#
Apply an equi-join between the left col_map and the right right_col_map.
Only inner-join semantics on a single key column are implemented. For each left row the converter finds the first matching right row by broadcasting an equality check over both key tensors, then uses
Compress(to drop non-matching left rows) andGather(to align right-table rows with their matching left-table rows).- Parameters:
g – the graph builder to add ONNX nodes to.
sts – shape/type context dict (forwarded verbatim; may be empty).
outputs – expected output column names (keys of the returned col_map).
op – the
JoinOpdescribing the join keys.col_map – mapping from column name to current ONNX tensor name (left table).
right_col_map – same for the right table.
- Returns:
a merged col_map containing all columns from both tables, aligned on the join key.