com.akiban.sql.parser
Class AggregateNode

java.lang.Object
  extended by com.akiban.sql.parser.QueryTreeNode
      extended by com.akiban.sql.parser.ValueNode
          extended by com.akiban.sql.parser.UnaryOperatorNode
              extended by com.akiban.sql.parser.AggregateNode
All Implemented Interfaces:
Visitable
Direct Known Subclasses:
GroupConcatNode

public class AggregateNode
extends UnaryOperatorNode

An Aggregate Node is a node that reprsents a set function/aggregate. It used for all system aggregates as well as user defined aggregates.


Field Summary
 
Fields inherited from class com.akiban.sql.parser.UnaryOperatorNode
methodName, operator, receiverInterfaceType, resultInterfaceType
 
Fields inherited from class com.akiban.sql.parser.QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
 
Constructor Summary
AggregateNode()
           
 
Method Summary
 void copyFrom(QueryTreeNode node)
          Fill this node with a deep copy of the given node.
 String getAggregateName()
          Get the name of the aggregate.
 void init(Object operand, Object uadClass, Object distinct, Object aggregateName)
          Intializer.
 boolean isDistinct()
          Indicate whether this aggregate is distinct or not.
 String toString()
          Convert this object to a String.
 
Methods inherited from class com.akiban.sql.parser.UnaryOperatorNode
getMethodName, getOperand, getOperator, init, init, isEquivalent, printSubNodes, setOperand
 
Methods inherited from class com.akiban.sql.parser.ValueNode
getColumnName, getSchemaName, getSourceResultColumn, getTableName, getType, getTypeId, init, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isConstantExpression, isInListProbeNode, isParameterNode, isRelationalOperator, isSameNodeType, setNullability, setType
 
Methods inherited from class com.akiban.sql.parser.QueryTreeNode
accept, convertDefaultNode, debugFlush, debugPrint, formatNodeString, getBeginOffset, getDebugOutput, getEndOffset, getNodeFactory, getNodeType, getNullNode, getParserContext, getStatementType, getUserData, init, init, init, init, init, init, init, init, init, init, isInstanceOf, makeTableName, makeTableName, nodeHeader, printLabel, setBeginOffset, setDebugOutput, setEndOffset, setNodeType, setParserContext, setUserData, stackPrint, treePrint, treePrint, treePrint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AggregateNode

public AggregateNode()
Method Detail

init

public void init(Object operand,
                 Object uadClass,
                 Object distinct,
                 Object aggregateName)
          throws StandardException
Intializer. Used for user defined and internally defined aggregates. Called when binding a StaticMethodNode that we realize is an aggregate.

Overrides:
init in class QueryTreeNode
Parameters:
operand - the value expression for the aggregate
uadClass - the class name for user aggregate definition for the aggregate or internal aggregate type.
distinct - boolean indicating whether this is distinct or not.
aggregateName - the name of the aggregate from the user's perspective, e.g. MAX
Throws:
StandardException - on error

copyFrom

public void copyFrom(QueryTreeNode node)
              throws StandardException
Fill this node with a deep copy of the given node.

Overrides:
copyFrom in class UnaryOperatorNode
Throws:
StandardException

getAggregateName

public String getAggregateName()
Get the name of the aggregate.

Returns:
the aggregate name

isDistinct

public boolean isDistinct()
Indicate whether this aggregate is distinct or not.

Returns:
true/false

toString

public String toString()
Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.

Overrides:
toString in class UnaryOperatorNode
Returns:
This object as a String


Copyright © 2013 Akiban Technologies, Inc. All rights reserved.