Package dev.frostlake.executor.operators
Class JoinOperator
java.lang.Object
dev.frostlake.executor.operators.JoinOperator
- All Implemented Interfaces:
Operator
JOIN operator - joins two sets of rows based on a condition.
This operator supports multiple join types:
- INNER JOIN: Returns rows when there's a match in both tables
- LEFT JOIN: Returns all rows from left table, matched rows from right
- RIGHT JOIN: Returns all rows from right table, matched rows from left
- FULL JOIN: Returns all rows when there's a match in either table
- CROSS JOIN: Returns Cartesian product of both tables
-
Constructor Summary
ConstructorsConstructorDescriptionJoinOperator(Table leftTable, Table rightTable, List<Row> rightRows, JoinType joinType, String joinCondition, JoinConditionEvaluator conditionEvaluator) Create a JOIN operator with a condition evaluator. -
Method Summary
Modifier and TypeMethodDescriptionstatic JoinOperatorCreate a CROSS JOIN operator (no condition).execute(List<Row> leftRows, OperatorContext context) Execute this operator on the input rows.Get a description of this operator for debugging/logging.withEquiKeys(int[] leftKeyIdx, int[] rightKeyIdx) Enable hash-join candidate filtering using the given equi-join key column indices.
-
Constructor Details
-
JoinOperator
public JoinOperator(Table leftTable, Table rightTable, List<Row> rightRows, JoinType joinType, String joinCondition, JoinConditionEvaluator conditionEvaluator) Create a JOIN operator with a condition evaluator.- Parameters:
leftTable- Left table metadatarightTable- Right table metadatarightRows- Rows from the right tablejoinType- Type of join to performjoinCondition- Join condition expression (null for CROSS JOIN)conditionEvaluator- Evaluator to evaluate join condition on pair of rows (null for CROSS JOIN)
-
-
Method Details
-
cross
Create a CROSS JOIN operator (no condition). -
withEquiKeys
Enable hash-join candidate filtering using the given equi-join key column indices. -
execute
Description copied from interface:OperatorExecute this operator on the input rows. -
getDescription
Description copied from interface:OperatorGet a description of this operator for debugging/logging.- Specified by:
getDescriptionin interfaceOperator- Returns:
- A human-readable description of the operator
-