class SqlItemOperator extends SqlSpecialOperator
[ ... ]
, used to access a given element of an
array or map. For example, myArray[3]
or "myMap['foo']"
.SqlSpecialOperator.ReduceResult, SqlSpecialOperator.TokenSequence
Modifier and Type | Field and Description |
---|---|
private static SqlSingleOperandTypeChecker |
ARRAY_OR_MAP |
kind, MDX_PRECEDENCE, NL
Constructor and Description |
---|
SqlItemOperator() |
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. |
java.lang.String |
getAllowedSignatures(java.lang.String name)
Returns a string describing the expected operand types of a call, e.g.
|
private SqlSingleOperandTypeChecker |
getChecker(SqlCallBinding callBinding) |
SqlOperandCountRange |
getOperandCountRange()
Returns a constraint on the number of operands expected by this operator.
|
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.
|
SqlSpecialOperator.ReduceResult |
reduceExpr(int ordinal,
SqlSpecialOperator.TokenSequence list)
Reduces a list of operators and arguments according to the rules of
precedence and associativity.
|
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.
|
getSyntax
acceptCall, acceptCall, adjustType, allowsFraming, argumentMustBeScalar, checkOperandCount, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, deriveType, equals, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getName, getNameAsId, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSignatureTemplate, hashCode, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, leftPrec, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateCall, validateOperands, validRexOperands
private static final SqlSingleOperandTypeChecker ARRAY_OR_MAP
public SqlSpecialOperator.ReduceResult reduceExpr(int ordinal, SqlSpecialOperator.TokenSequence list)
SqlSpecialOperator
The default implementation throws
UnsupportedOperationException
.
reduceExpr
in class SqlSpecialOperator
ordinal
- indicating the ordinal of the current operator in the list
on which a possible reduction can be madelist
- List of alternating
SqlParserUtil.ToTreeListItem
and
SqlNode
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 SqlOperator
public SqlOperandCountRange getOperandCountRange()
SqlOperator
SqlOperandTypeChecker
associated with this
operator.getOperandCountRange
in class SqlOperator
public 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)private SqlSingleOperandTypeChecker getChecker(SqlCallBinding callBinding)
public java.lang.String getAllowedSignatures(java.lang.String name)
SqlOperator
getAllowedSignatures
in class SqlOperator
public RelDataType inferReturnType(SqlOperatorBinding opBinding)
SqlOperator
SqlReturnTypeInference
to the constructor.inferReturnType
in class SqlOperator
opBinding
- description of invocation (not necessarily a
SqlCall
)Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.