public class SqlTrimFunction extends SqlFunction
Modifier and Type | Class and Description |
---|---|
static class |
SqlTrimFunction.Flag
Defines the enumerated values "LEADING", "TRAILING", "BOTH".
|
Modifier and Type | Field and Description |
---|---|
protected static SqlTrimFunction |
INSTANCE |
kind, MDX_PRECEDENCE, NL
Constructor and Description |
---|
SqlTrimFunction(java.lang.String name,
SqlKind kind,
SqlTypeTransformCascade returnTypeInference,
SqlSingleOperandTypeChecker operandTypeChecker) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkOperandTypes(SqlCallBinding callBinding,
boolean throwOnFailure)
Checks that the operand values in a
SqlCall to this operator are
valid. |
SqlCall |
createCall(SqlLiteral functionQualifier,
SqlParserPos pos,
SqlNode... operands)
Creates a call to this operand with an array of operands.
|
java.lang.String |
getSignatureTemplate(int operandsCount)
Returns a template describing how the operator signature is to be built.
|
void |
unparse(SqlWriter writer,
SqlCall call,
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.
|
deriveType, getFunctionType, getNameAsId, getParamNames, getParamTypes, getSqlIdentifier, getSyntax, isQuantifierAllowed, validateCall, validateQuantifier
acceptCall, acceptCall, adjustType, allowsFraming, argumentMustBeScalar, checkOperandCount, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getName, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, leftPrec, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands
protected static final SqlTrimFunction INSTANCE
public SqlTrimFunction(java.lang.String name, SqlKind kind, SqlTypeTransformCascade returnTypeInference, SqlSingleOperandTypeChecker operandTypeChecker)
public void unparse(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec)
SqlOperator
The default implementation of this method delegates to
SqlSyntax.unparse(org.apache.calcite.sql.SqlWriter, org.apache.calcite.sql.SqlOperator, org.apache.calcite.sql.SqlCall, int, int)
.
unparse
in class SqlFunction
public java.lang.String getSignatureTemplate(int operandsCount)
SqlOperator
getSignatureTemplate
in class SqlOperator
operandsCount
- is used with functions that can take a variable
number of operandspublic SqlCall createCall(SqlLiteral functionQualifier, SqlParserPos pos, SqlNode... operands)
SqlOperator
The position of the resulting call is the union of the
pos
and the positions of all of the operands.
createCall
in class SqlOperator
functionQualifier
- function qualifier (e.g. "DISTINCT"), may bepos
- parser position of the identifier of the calloperands
- array of operandspublic boolean checkOperandTypes(SqlCallBinding callBinding, boolean throwOnFailure)
SqlOperator
SqlCall
to this operator are
valid. Subclasses must either override this method or supply an instance
of SqlOperandTypeChecker
to the constructor.checkOperandTypes
in class SqlOperator
callBinding
- description of callthrowOnFailure
- whether to throw an exception if check fails
(otherwise returns false in that case)Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.