Class JoinOperator

java.lang.Object
dev.frostlake.executor.operators.JoinOperator
All Implemented Interfaces:
Operator

public class JoinOperator extends Object implements 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 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 metadata
      rightTable - Right table metadata
      rightRows - Rows from the right table
      joinType - Type of join to perform
      joinCondition - Join condition expression (null for CROSS JOIN)
      conditionEvaluator - Evaluator to evaluate join condition on pair of rows (null for CROSS JOIN)
  • Method Details

    • cross

      public static JoinOperator cross(Table leftTable, Table rightTable, List<Row> rightRows)
      Create a CROSS JOIN operator (no condition).
    • withEquiKeys

      public JoinOperator withEquiKeys(int[] leftKeyIdx, int[] rightKeyIdx)
      Enable hash-join candidate filtering using the given equi-join key column indices.
    • execute

      public List<Row> execute(List<Row> leftRows, OperatorContext context)
      Description copied from interface: Operator
      Execute this operator on the input rows.
      Specified by:
      execute in interface Operator
      Parameters:
      leftRows - The input rows from the previous operator
      context - The execution context containing table metadata and other information
      Returns:
      The output rows after applying this operator
    • getDescription

      public String getDescription()
      Description copied from interface: Operator
      Get a description of this operator for debugging/logging.
      Specified by:
      getDescription in interface Operator
      Returns:
      A human-readable description of the operator