Class TableFunctionOperator

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

public class TableFunctionOperator extends Object implements Operator
TABLE FUNCTION operator - executes table-valued functions. This operator handles execution of table functions like GENERATOR, RESULT_SCAN, and other table-valued functions that generate rows. Table functions differ from regular operators as they don't take input rows - they generate rows from scratch based on their arguments.
  • Constructor Details

    • TableFunctionOperator

      public TableFunctionOperator(String functionName, TableFunction tableFunction, Map<String,Object> namedArguments)
      Create a table function operator with named arguments.
      Parameters:
      functionName - Name of the table function
      tableFunction - The table function to execute
      namedArguments - Named arguments (e.g., ROWCOUNT => 10)
    • TableFunctionOperator

      public TableFunctionOperator(String functionName, TableFunction tableFunction, List<Object> positionalArguments)
      Create a table function operator with positional arguments.
      Parameters:
      functionName - Name of the table function
      tableFunction - The table function to execute
      positionalArguments - Positional arguments
    • TableFunctionOperator

      public TableFunctionOperator(String functionName, ResultSetProvider resultProvider)
      Create a table function operator with a custom result provider. Useful for special cases like RESULT_SCAN with LAST_QUERY_ID().
      Parameters:
      functionName - Name of the table function
      resultProvider - Provider that produces the ResultSet
  • Method Details

    • execute

      public List<Row> execute(List<Row> input, OperatorContext context)
      Description copied from interface: Operator
      Execute this operator on the input rows.
      Specified by:
      execute in interface Operator
      Parameters:
      input - 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