All Implemented Interfaces:
BoxVisitable
Direct Known Subclasses:
SQLCountFunction

public class SQLFunction extends SQLExpression
Abstract Node class representing SQL function call
  • Constructor Details

    • SQLFunction

      public SQLFunction(Key name, List<SQLExpression> arguments, Position position, String sourceText)
      Constructor
      Parameters:
      position - position of the statement in the source code
      sourceText - source code of the statement
  • Method Details

    • getName

      public Key getName()
      Get the name of the function
      Returns:
      the name of the function
    • setName

      public void setName(Key name)
      Set the name of the function
      Parameters:
      name - the name of the function
    • getArguments

      public List<SQLExpression> getArguments()
      Get the arguments of the function
      Returns:
      the arguments of the function
    • setArguments

      public void setArguments(List<SQLExpression> arguments)
      Set the arguments of the function
      Parameters:
      arguments - the arguments of the function
    • isBoolean

      public boolean isBoolean(QoQSelectExecution QoQExec)
      Runtime check if the expression evaluates to a boolean value and works for columns as well
      Overrides:
      isBoolean in class SQLExpression
      Parameters:
      QoQExec - Query execution state
      Returns:
      true if the expression evaluates to a boolean value
    • isNumeric

      public boolean isNumeric(QoQSelectExecution QoQExec)
      Runtime check if the expression evaluates to a numeric value and works for columns as well
      Overrides:
      isNumeric in class SQLExpression
      Parameters:
      QoQExec - Query execution state
      Returns:
      true if the expression evaluates to a numeric value
    • isAggregate

      public boolean isAggregate()
      Is function aggregate
    • getType

      public QueryColumnType getType(QoQSelectExecution QoQExec)
      What type does this expression evaluate to
      Overrides:
      getType in class SQLExpression
    • evaluate

      public Object evaluate(QoQSelectExecution QoQExec, int[] intersection)
      Evaluate the expression
      Specified by:
      evaluate in class SQLExpression
    • evaluateAggregate

      public Object evaluateAggregate(QoQSelectExecution QoQExec, List<int[]> intersections)
      Evaluate the expression aginst a partition of data
      Specified by:
      evaluateAggregate in class SQLExpression
    • buildAggregateValues

      protected Object[] buildAggregateValues(QoQSelectExecution QoQExec, List<int[]> intersections, SQLExpression argument)
    • accept

      public void accept(VoidBoxVisitor v)
      Description copied from interface: BoxVisitable
      Accept method for visitor support.
      Parameters:
      v - the visitor implementation
    • accept

      public BoxNode accept(ReplacingBoxVisitor v)
      Description copied from interface: BoxVisitable
      Accept method for replacing visitor support. Each accept returns the node, or a replacement node.
      Parameters:
      v - the visitor implementation
    • toMap

      public Map<String,Object> toMap()
      Overrides:
      toMap in class BoxNode