Package org.apache.calcite.sql
Class SqlPrefixOperator
- java.lang.Object
-
- org.apache.calcite.sql.SqlOperator
-
- org.apache.calcite.sql.SqlPrefixOperator
-
- Direct Known Subclasses:
SqlNewOperator
,SqlProcedureCallOperator
public class SqlPrefixOperator extends SqlOperator
A unary operator.
-
-
Field Summary
-
Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL
-
-
Constructor Summary
Constructors Constructor Description SqlPrefixOperator(java.lang.String name, SqlKind kind, int prec, SqlReturnTypeInference returnTypeInference, SqlOperandTypeInference operandTypeInference, SqlOperandTypeChecker operandTypeChecker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RelDataType
adjustType(SqlValidator validator, SqlCall call, RelDataType type)
Validates and determines coercibility and resulting collation name of binary operator if needed.SqlMonotonicity
getMonotonicity(SqlOperatorBinding call)
Returns whether a call to this operator is monotonic.java.lang.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, Litmus litmus)
Returns whether the given operands are valid.-
Methods inherited from class org.apache.calcite.sql.SqlOperator
acceptCall, acceptCall, allowsFraming, argumentMustBeScalar, checkOperandCount, checkOperandTypes, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, deriveType, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getName, getNameAsId, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, leftPrec, needsSpace, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, rewriteCall, rightPrec, toString, unparse, unparseListClause, unparseListClause, validateCall, validateOperands
-
-
-
-
Constructor Detail
-
SqlPrefixOperator
public SqlPrefixOperator(java.lang.String name, SqlKind kind, int prec, SqlReturnTypeInference returnTypeInference, SqlOperandTypeInference operandTypeInference, SqlOperandTypeChecker operandTypeChecker)
-
-
Method Detail
-
getSyntax
public SqlSyntax getSyntax()
Description copied from class:SqlOperator
Returns the syntactic type of this operator, never null.- Specified by:
getSyntax
in classSqlOperator
-
getSignatureTemplate
public java.lang.String getSignatureTemplate(int operandsCount)
Description copied from class:SqlOperator
Returns a template describing how the operator signature is to be built. E.g for the binary + operator the template looks like "{1} {0} {2}" {0} is the operator, subsequent numbers are operands.- Overrides:
getSignatureTemplate
in classSqlOperator
- Parameters:
operandsCount
- is used with functions that can take a variable number of operands- Returns:
- signature template, or null to indicate that a default template will suffice
-
adjustType
protected RelDataType adjustType(SqlValidator validator, SqlCall call, RelDataType type)
Description copied from class:SqlOperator
Validates and determines coercibility and resulting collation name of binary operator if needed.- Overrides:
adjustType
in classSqlOperator
-
getMonotonicity
public SqlMonotonicity getMonotonicity(SqlOperatorBinding call)
Description copied from class:SqlOperator
Returns whether a call to this operator is monotonic.Default implementation returns
SqlMonotonicity.NOT_MONOTONIC
.- Overrides:
getMonotonicity
in classSqlOperator
- Parameters:
call
- Call to this operator with particular arguments and information about the monotonicity of the arguments
-
validRexOperands
public boolean validRexOperands(int count, Litmus litmus)
Description copied from class:SqlOperator
Returns whether the given operands are valid. If not valid andfail
, 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 inSqlNode
andRexNode
formats (some examples are CAST and AND), and this method throws internal errors, not user errors.- Overrides:
validRexOperands
in classSqlOperator
-
-