public class SqlBinaryOperator extends SqlOperator
SqlBinaryOperator is a binary operator.kind, MDX_PRECEDENCE, NL| Constructor and Description |
|---|
SqlBinaryOperator(String name,
SqlKind kind,
int prec,
boolean leftAssoc,
SqlReturnTypeInference returnTypeInference,
SqlOperandTypeInference operandTypeInference,
SqlOperandTypeChecker operandTypeChecker)
Creates a SqlBinaryOperator.
|
| Modifier and Type | Method and Description |
|---|---|
protected RelDataType |
adjustType(SqlValidator validator,
SqlCall call,
RelDataType type)
Validates and determines coercibility and resulting collation name of
binary operator if needed.
|
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.
|
String |
getSignatureTemplate(int operandsCount)
Returns a template describing how the operator signature is to be built.
|
SqlSyntax |
getSyntax()
Returns the syntactic type of this operator, never null.
|
boolean |
validRexOperands(int count,
boolean fail)
Returns whether the given operands are valid.
|
acceptCall, acceptCall, allowsFraming, 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, requiresOrder, rewriteCall, rightPrec, toString, unparse, unparseListClause, unparseListClause, validateCall, validateOperandspublic SqlBinaryOperator(String name, SqlKind kind, int prec, boolean leftAssoc, SqlReturnTypeInference returnTypeInference, SqlOperandTypeInference operandTypeInference, SqlOperandTypeChecker operandTypeChecker)
name - Name of operatorkind - Kindprec - PrecedenceleftAssoc - Left-associativityreturnTypeInference - Strategy to infer return typeoperandTypeInference - Strategy to infer operand typesoperandTypeChecker - Validator for operand typespublic SqlSyntax getSyntax()
SqlOperatorgetSyntax in class SqlOperatorpublic String getSignatureTemplate(int operandsCount)
SqlOperatorgetSignatureTemplate in class SqlOperatoroperandsCount - is used with functions that can take a variable
number of operandsprotected RelDataType adjustType(SqlValidator validator, SqlCall call, RelDataType type)
SqlOperatoradjustType in class SqlOperatorpublic RelDataType deriveType(SqlValidator validator, SqlValidatorScope scope, SqlCall call)
SqlOperatorThis method is an intrinsic part of the validation process so, unlike
SqlOperator.inferReturnType(org.apache.calcite.sql.SqlOperatorBinding), specific operators would not typically override
this method.
deriveType in class SqlOperatorvalidator - Validatorscope - Scope of validationcall - Call to this operatorpublic SqlMonotonicity getMonotonicity(SqlCall call, SqlValidatorScope scope)
SqlOperatorDefault implementation returns SqlMonotonicity.NOT_MONOTONIC.
getMonotonicity in class SqlOperatorcall - Call to this operatorscope - Scope in which the call occurspublic boolean validRexOperands(int count,
boolean fail)
SqlOperatorfail, throws an assertion error.
Similar to SqlOperator.checkOperandCount(org.apache.calcite.sql.validate.SqlValidator, org.apache.calcite.sql.type.SqlOperandTypeChecker, org.apache.calcite.sql.SqlCall), but some operators may have
different valid operands in SqlNode and RexNode formats
(some examples are CAST and AND), and this method throws internal errors,
not user errors.
validRexOperands in class SqlOperatorCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.