public class RexCallBinding extends SqlOperatorBinding
RexCallBinding
implements SqlOperatorBinding
by
referring to an underlying collection of RexNode
operands.Modifier and Type | Class and Description |
---|---|
private static class |
RexCallBinding.RexCastCallBinding
To be compatible with
SqlCall , CAST needs to pretend that it
has two arguments, the second of which is the target type. |
Modifier and Type | Field and Description |
---|---|
private java.util.List<RelCollation> |
inputCollations |
private java.util.List<RexNode> |
operands |
typeFactory
Constructor and Description |
---|
RexCallBinding(RelDataTypeFactory typeFactory,
SqlOperator sqlOperator,
java.util.List<? extends RexNode> operands,
java.util.List<RelCollation> inputCollations) |
Modifier and Type | Method and Description |
---|---|
static RexCallBinding |
create(RelDataTypeFactory typeFactory,
RexCall call,
java.util.List<RelCollation> inputCollations)
Creates a binding of the appropriate type.
|
int |
getIntLiteralOperand(int ordinal)
Gets the integer value of a numeric literal operand.
|
int |
getOperandCount() |
<T> T |
getOperandLiteralValue(int ordinal,
java.lang.Class<T> clazz)
Gets the value of a literal operand.
|
SqlMonotonicity |
getOperandMonotonicity(int ordinal)
Gets the monotonicity of a bound operand.
|
RelDataType |
getOperandType(int ordinal)
Gets the type of a bound operand.
|
java.lang.String |
getStringLiteralOperand(int ordinal)
Gets the string value of a string literal operand.
|
boolean |
isOperandLiteral(int ordinal,
boolean allowCast)
Determines whether an operand is a literal.
|
boolean |
isOperandNull(int ordinal,
boolean allowCast)
Determines whether a bound operand is NULL.
|
CalciteException |
newError(Resources.ExInst<SqlValidatorException> e)
Wraps a validation error with context appropriate to this operator call.
|
collectOperandTypes, getColumnListParamInfo, getCursorOperand, getGroupCount, getOperandLiteralValue, getOperator, getTypeFactory, hasFilter
private final java.util.List<RexNode> operands
private final java.util.List<RelCollation> inputCollations
public RexCallBinding(RelDataTypeFactory typeFactory, SqlOperator sqlOperator, java.util.List<? extends RexNode> operands, java.util.List<RelCollation> inputCollations)
public static RexCallBinding create(RelDataTypeFactory typeFactory, RexCall call, java.util.List<RelCollation> inputCollations)
public java.lang.String getStringLiteralOperand(int ordinal)
SqlOperatorBinding
getStringLiteralOperand
in class SqlOperatorBinding
ordinal
- zero-based ordinal of operand of interestpublic int getIntLiteralOperand(int ordinal)
SqlOperatorBinding
getIntLiteralOperand
in class SqlOperatorBinding
ordinal
- zero-based ordinal of operand of interestpublic <T> T getOperandLiteralValue(int ordinal, java.lang.Class<T> clazz)
SqlOperatorBinding
Cases:
NlsString
.
BigDecimal
.
SqlIntervalQualifier
getOperandLiteralValue
in class SqlOperatorBinding
ordinal
- zero-based ordinal of operand of interestclazz
- Desired valued typepublic SqlMonotonicity getOperandMonotonicity(int ordinal)
SqlOperatorBinding
getOperandMonotonicity
in class SqlOperatorBinding
ordinal
- zero-based ordinal of operand of interestpublic boolean isOperandNull(int ordinal, boolean allowCast)
SqlOperatorBinding
This is only relevant for SQL validation.
isOperandNull
in class SqlOperatorBinding
ordinal
- zero-based ordinal of operand of interestallowCast
- whether to regard CAST(constant) as a constantpublic boolean isOperandLiteral(int ordinal, boolean allowCast)
SqlOperatorBinding
isOperandLiteral
in class SqlOperatorBinding
ordinal
- zero-based ordinal of operand of interestallowCast
- whether to regard CAST(literal) as a literalpublic int getOperandCount()
getOperandCount
in class SqlOperatorBinding
public RelDataType getOperandType(int ordinal)
SqlOperatorBinding
getOperandType
in class SqlOperatorBinding
ordinal
- zero-based ordinal of operand of interestpublic CalciteException newError(Resources.ExInst<SqlValidatorException> e)
SqlOperatorBinding
newError
in class SqlOperatorBinding
e
- Validation error, not nullCopyright © 2012–2019 The Apache Software Foundation. All rights reserved.