|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eigenbase.sql.SqlOperator
org.eigenbase.sql.SqlSpecialOperator
org.eigenbase.sql.SqlAsOperator
public class SqlAsOperator
The AS operator associates an expression with an alias.
| Field Summary |
|---|
| Fields inherited from class org.eigenbase.sql.SqlOperator |
|---|
MaxPrec, NL |
| Constructor Summary | |
|---|---|
SqlAsOperator()
Creates an AS operator. |
|
| Method Summary | ||
|---|---|---|
|
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. |
|
SqlMonotonicity |
getMonotonicity(SqlCall call,
SqlValidatorScope scope)
Returns whether this operator is monotonic. |
|
void |
unparse(SqlWriter writer,
SqlNode[] operands,
int leftPrec,
int rightPrec)
Writes a SQL representation of a call to this operator to a writer, including parentheses if the operators on either side are of greater precedence. |
|
void |
validateCall(SqlCall call,
SqlValidator validator,
SqlValidatorScope scope,
SqlValidatorScope operandScope)
Validates a call to this operator. |
|
| Methods inherited from class org.eigenbase.sql.SqlSpecialOperator |
|---|
getSyntax, reduceExpr |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SqlAsOperator()
| Method Detail |
|---|
public void unparse(SqlWriter writer,
SqlNode[] operands,
int leftPrec,
int rightPrec)
SqlOperatorThe default implementation of this method delegates to SqlSyntax.unparse(org.eigenbase.sql.SqlWriter, org.eigenbase.sql.SqlOperator, org.eigenbase.sql.SqlNode[], int, int).
unparse in class SqlSpecialOperator
public void validateCall(SqlCall call,
SqlValidator validator,
SqlValidatorScope scope,
SqlValidatorScope operandScope)
SqlOperatorThis 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.
validateCall in class SqlOperatorcall - the call to this operatorvalidator - the active validatorscope - validator scopeoperandScope - validator scope in which to validate operands to this
call; usually equal to scope, but not always because some operators
introduce new scopesSqlNode.validateExpr(SqlValidator, SqlValidatorScope),
SqlOperator.deriveType(SqlValidator, SqlValidatorScope, SqlCall)
public <R> void acceptCall(SqlVisitor<R> visitor,
SqlCall call,
boolean onlyExpressions,
SqlBasicVisitor.ArgHandler<R> argHandler)
SqlOperatorSqlVisitor, 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.
acceptCall in class SqlOperatorvisitor - Visitorcall - Call to visitonlyExpressions - If true, ignores operands which are not
expressions. For example, in the call to the AS operatorargHandler - Called for each operand
public RelDataType deriveType(SqlValidator validator,
SqlValidatorScope scope,
SqlCall call)
SqlOperatorThis 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.
deriveType in class SqlOperatorvalidator - Validatorscope - Scope of validationcall - Call to this operator
public SqlMonotonicity getMonotonicity(SqlCall call,
SqlValidatorScope scope)
SqlOperatorDefault implementation returns SqlMonotonicity.NotMonotonic.
getMonotonicity in class SqlOperatorcall - Call to this operatorscope - Scope in which the call occurs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||