org.eigenbase.sql
Class SqlAggFunction

java.lang.Object
  extended by org.eigenbase.sql.SqlOperator
      extended by org.eigenbase.sql.SqlFunction
          extended by org.eigenbase.sql.SqlAggFunction
All Implemented Interfaces:
Aggregation
Direct Known Subclasses:
SqlAvgAggFunction, SqlCountAggFunction, SqlFirstLastValueAggFunction, SqlHistogramAggFunction, SqlMinMaxAggFunction, SqlRankFunction, SqlSingleValueAggFunction, SqlSumAggFunction, SqlSumEmptyIsZeroAggFunction

public abstract class SqlAggFunction
extends SqlFunction
implements Aggregation

Abstract base class for the definition of an aggregate function: an operator which aggregates sets of values into a result.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/SqlAggFunction.java#20 $
Author:
jhyde

Field Summary
 
Fields inherited from class org.eigenbase.sql.SqlOperator
MaxPrec, NL
 
Constructor Summary
SqlAggFunction(String name, SqlKind kind, SqlReturnTypeInference returnTypeInference, SqlOperandTypeInference operandTypeInference, SqlOperandTypeChecker operandTypeChecker, SqlFunctionCategory funcType)
           
 
Method Summary
 OJClass[] getStartParameterTypes()
           
 boolean isQuantifierAllowed()
          Returns whether this function allows a DISTINCT or ALL quantifier.
 void validateCall(SqlCall call, SqlValidator validator, SqlValidatorScope scope, SqlValidatorScope operandScope)
          Validates a call to this operator.
 
Methods inherited from class org.eigenbase.sql.SqlFunction
deriveType, getFunctionType, getNameAsId, getParamTypes, getSqlIdentifier, getSyntax, unparse, validateQuantifier
 
Methods inherited from class org.eigenbase.sql.SqlOperator
acceptCall, acceptCall, adjustType, argumentMustBeScalar, checkOperandCount, checkOperandTypes, createCall, createCall, createCall, createCall, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getName, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSignatureTemplate, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isName, leftPrec, preValidateCall, requiresDecimalExpansion, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eigenbase.rel.Aggregation
getName, getParameterTypes, getReturnType
 

Constructor Detail

SqlAggFunction

public SqlAggFunction(String name,
                      SqlKind kind,
                      SqlReturnTypeInference returnTypeInference,
                      SqlOperandTypeInference operandTypeInference,
                      SqlOperandTypeChecker operandTypeChecker,
                      SqlFunctionCategory funcType)
Method Detail

getStartParameterTypes

public OJClass[] getStartParameterTypes()

isQuantifierAllowed

public boolean isQuantifierAllowed()
Description copied from class: SqlFunction
Returns whether this function allows a DISTINCT or ALL quantifier. The default is false; some aggregate functions return true.

Overrides:
isQuantifierAllowed in class SqlFunction

validateCall

public void validateCall(SqlCall call,
                         SqlValidator validator,
                         SqlValidatorScope scope,
                         SqlValidatorScope operandScope)
Description copied from class: SqlOperator
Validates a call to this operator.

This method should not perform type-derivation or perform validation related related to types. That is done later, by SqlOperator.deriveType(SqlValidator, SqlValidatorScope, SqlCall). This method should focus on structural validation.

A typical implementation of this method first validates the operands, then performs some operator-specific logic. The default implementation just validates the operands.

This method is the default implementation of SqlCall.validate(org.eigenbase.sql.validate.SqlValidator, org.eigenbase.sql.validate.SqlValidatorScope); but note that some sub-classes of SqlCall never call this method.

Overrides:
validateCall in class SqlFunction
Parameters:
call - the call to this operator
validator - the active validator
scope - validator scope
operandScope - validator scope in which to validate operands to this call; usually equal to scope, but not always because some operators introduce new scopes
See Also:
SqlNode.validateExpr(SqlValidator, SqlValidatorScope), SqlOperator.deriveType(SqlValidator, SqlValidatorScope, SqlCall)