org.eigenbase.sql
Class SqlOverOperator

java.lang.Object
  extended by org.eigenbase.sql.SqlOperator
      extended by org.eigenbase.sql.SqlBinaryOperator
          extended by org.eigenbase.sql.SqlOverOperator

public class SqlOverOperator
extends SqlBinaryOperator

An operator describing a window function specification.

Operands are as follows:

Since:
Nov 4, 2004
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/SqlOverOperator.java#16 $
Author:
klo

Field Summary
 
Fields inherited from class org.eigenbase.sql.SqlOperator
MaxPrec, NL
 
Constructor Summary
SqlOverOperator()
           
 
Method Summary
<R> void
acceptCall(SqlVisitor<R> visitor, SqlCall call, boolean onlyExpressions, SqlBasicVisitor.ArgHandler<R> argHandler)
          Accepts a SqlVisitor, directing an SqlBasicVisitor.ArgHandler to visit operand of a call.
 RelDataType deriveType(SqlValidator validator, SqlValidatorScope scope, SqlCall call)
          Derives the type of a call to this operator.
 void validateCall(SqlCall call, SqlValidator validator, SqlValidatorScope scope, SqlValidatorScope operandScope)
          Validates a call to this operator.
 
Methods inherited from class org.eigenbase.sql.SqlBinaryOperator
adjustType, getMonotonicity, getSignatureTemplate, getSyntax, needsSpace
 
Methods inherited from class org.eigenbase.sql.SqlOperator
acceptCall, argumentMustBeScalar, checkOperandCount, checkOperandTypes, createCall, createCall, createCall, createCall, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getName, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isName, leftPrec, preValidateCall, requiresDecimalExpansion, rewriteCall, rightPrec, toString, unparse, unparseListClause, unparseListClause, validateOperands
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SqlOverOperator

public SqlOverOperator()
Method Detail

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

deriveType

public RelDataType deriveType(SqlValidator validator,
                              SqlValidatorScope scope,
                              SqlCall call)
Description copied from class: SqlOperator
Derives the type of a call to this operator.

This method is an intrinsic part of the validation process so, unlike SqlOperator.inferReturnType(org.eigenbase.sql.SqlOperatorBinding), specific operators would not typically override this method.

Overrides:
deriveType in class SqlBinaryOperator
Parameters:
validator - Validator
scope - Scope of validation
call - Call to this operator
Returns:
Type of call

acceptCall

public <R> void acceptCall(SqlVisitor<R> visitor,
                           SqlCall call,
                           boolean onlyExpressions,
                           SqlBasicVisitor.ArgHandler<R> argHandler)
Description copied from class: SqlOperator
Accepts a SqlVisitor, directing an SqlBasicVisitor.ArgHandler to visit operand of a call. The argument handler allows fine control about how the operands are visited, and how the results are combined.

Overrides:
acceptCall in class SqlOperator
Parameters:
visitor - Visitor
call - Call to visit
onlyExpressions - If true, ignores operands which are not expressions. For example, in the call to the AS operator
argHandler - Called for each operand