|
|||||||||
| 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.SqlInternalOperator
org.eigenbase.sql.fun.SqlLiteralChainOperator
public class SqlLiteralChainOperator
Internal operator, by which the parser represents a continued string literal.
The string fragments are SqlLiteral objects, all of the same type,
collected as the operands of an SqlCall using this operator. After
validation, the fragments will be concatenated into a single literal.
For a chain of SqlCharStringLiteral objects, a
SqlCollation object is attached only to the head of the chain.
| Field Summary |
|---|
| Fields inherited from class org.eigenbase.sql.SqlOperator |
|---|
MaxPrec, NL |
| Constructor Summary | |
|---|---|
SqlLiteralChainOperator()
|
|
| Method Summary | |
|---|---|
private boolean |
argTypesValid(SqlCallBinding callBinding)
|
boolean |
checkOperandTypes(SqlCallBinding callBinding,
boolean throwOnFailure)
Checks that the operand values in a SqlCall to this operator are
valid. |
static SqlLiteral |
concatenateOperands(SqlCall call)
Concatenates the operands of a call to this operator. |
String |
getAllowedSignatures(String opName)
Returns a string describing the expected operand types of a call, e.g. |
RelDataType |
inferReturnType(SqlOperatorBinding opBinding)
Infers the return type of an invocation of this operator; only called after the number and types of operands have already been validated. |
void |
unparse(SqlWriter writer,
SqlNode[] rands,
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.SqlInternalOperator |
|---|
getSyntax |
| Methods inherited from class org.eigenbase.sql.SqlSpecialOperator |
|---|
reduceExpr |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
SqlLiteralChainOperator()
| Method Detail |
|---|
private boolean argTypesValid(SqlCallBinding callBinding)
public boolean checkOperandTypes(SqlCallBinding callBinding,
boolean throwOnFailure)
SqlOperatorSqlCall to this operator are
valid. Subclasses must either override this method or supply an instance
of SqlOperandTypeChecker to the constructor.
checkOperandTypes in class SqlOperatorcallBinding - description of callthrowOnFailure - whether to throw an exception if check fails
(otherwise returns false in that case)
public RelDataType inferReturnType(SqlOperatorBinding opBinding)
SqlOperatorSqlReturnTypeInference to the constructor.
inferReturnType in class SqlOperatoropBinding - description of invocation (not necessarily a SqlCall)
public String getAllowedSignatures(String opName)
SqlOperator
getAllowedSignatures in class SqlOperator
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 void unparse(SqlWriter writer,
SqlNode[] rands,
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 SqlInternalOperatorpublic static SqlLiteral concatenateOperands(SqlCall call)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||