org.eigenbase.sql
Class SqlRankFunction

java.lang.Object
  extended by org.eigenbase.sql.SqlOperator
      extended by org.eigenbase.sql.SqlFunction
          extended by org.eigenbase.sql.SqlAggFunction
              extended by org.eigenbase.sql.SqlRankFunction
All Implemented Interfaces:
Aggregation

public class SqlRankFunction
extends SqlAggFunction

Operator which aggregates sets of values into a result.

Since:
Jun 3, 2005
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/SqlRankFunction.java#10 $
Author:
jack

Field Summary
private  RelDataType type
           
 
Fields inherited from class org.eigenbase.sql.SqlOperator
MaxPrec, NL
 
Constructor Summary
SqlRankFunction(String name)
           
 
Method Summary
 SqlOperandCountRange getOperandCountRange()
          Returns a constraint on the number of operands expected by this operator.
 RelDataType[] getParameterTypes(RelDataTypeFactory typeFactory)
          Returns the parameter types accepted by this Aggregation.
 RelDataType getReturnType(RelDataTypeFactory typeFactory)
          Returns the type of the result yielded by this Aggregation.
 boolean isAggregator()
          Returns whether this operator is an aggregate function.
 void validateCall(SqlCall call, SqlValidator validator, SqlValidatorScope scope, SqlValidatorScope operandScope)
          Validates a call to this operator.
 
Methods inherited from class org.eigenbase.sql.SqlAggFunction
getStartParameterTypes, isQuantifierAllowed
 
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, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSignatureTemplate, hashCode, inferReturnType, inferReturnType, 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
 

Field Detail

type

private final RelDataType type
Constructor Detail

SqlRankFunction

public SqlRankFunction(String name)
Method Detail

getOperandCountRange

public SqlOperandCountRange getOperandCountRange()
Description copied from class: SqlOperator
Returns a constraint on the number of operands expected by this operator. Subclasses may override this method; when they don't, the range is derived from the SqlOperandTypeChecker associated with this operator.

Overrides:
getOperandCountRange in class SqlOperator
Returns:
acceptable range

getReturnType

public RelDataType getReturnType(RelDataTypeFactory typeFactory)
Description copied from interface: Aggregation
Returns the type of the result yielded by this Aggregation.

Parameters:
typeFactory - Type factory to create the type
Returns:
Result type

getParameterTypes

public RelDataType[] getParameterTypes(RelDataTypeFactory typeFactory)
Description copied from interface: Aggregation
Returns the parameter types accepted by this Aggregation.

Parameters:
typeFactory - Type factory to create the types
Returns:
Array of parameter types

isAggregator

public boolean isAggregator()
Description copied from class: SqlOperator
Returns whether this operator is an aggregate function. By default, subclass type is used (an instance of SqlAggFunction is assumed to be an aggregator; anything else is not).

Overrides:
isAggregator in class SqlOperator
Returns:
whether this operator is an aggregator

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 SqlAggFunction
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)