public abstract class SqlOperatorBinding extends Object
SqlOperatorBinding represents the binding of an
SqlOperator to actual operands, along with any additional information
required to validate those operands if needed.| Modifier and Type | Field and Description |
|---|---|
protected RelDataTypeFactory |
typeFactory |
| Modifier | Constructor and Description |
|---|---|
protected |
SqlOperatorBinding(RelDataTypeFactory typeFactory,
SqlOperator sqlOperator)
Creates a SqlOperatorBinding.
|
| Modifier and Type | Method and Description |
|---|---|
List<RelDataType> |
collectOperandTypes()
Collects the types of the bound operands into a list.
|
@Nullable String |
getColumnListParamInfo(int ordinal,
String paramName,
List<String> columnList)
Retrieves information about a column list parameter.
|
@Nullable RelDataType |
getCursorOperand(int ordinal)
Returns the rowtype of the
ordinalth operand, which is a
cursor. |
int |
getGroupCount()
If the operator call occurs in an aggregate query, returns the number of
columns in the GROUP BY clause.
|
int |
getIntLiteralOperand(int ordinal)
Deprecated.
|
abstract int |
getOperandCount()
Returns the number of bound operands.
|
@Nullable Comparable |
getOperandLiteralValue(int ordinal)
Deprecated.
|
<T> T |
getOperandLiteralValue(int ordinal,
Class<T> clazz)
Gets the value of a literal operand.
|
@Nullable Object |
getOperandLiteralValue(int ordinal,
RelDataType type)
Gets the value of a literal operand as a Calcite type.
|
SqlMonotonicity |
getOperandMonotonicity(int ordinal)
Gets the monotonicity of a bound operand.
|
abstract RelDataType |
getOperandType(int ordinal)
Gets the type of a bound operand.
|
SqlOperator |
getOperator()
Returns the bound operator.
|
@Nullable String |
getStringLiteralOperand(int ordinal)
Deprecated.
|
RelDataTypeFactory |
getTypeFactory()
Returns the factory for type creation.
|
boolean |
hasFilter()
Returns whether the operator is an aggregate function with a filter.
|
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.
|
abstract CalciteException |
newError(org.apache.calcite.runtime.Resources.ExInst<SqlValidatorException> e)
Wraps a validation error with context appropriate to this operator call.
|
protected final RelDataTypeFactory typeFactory
protected SqlOperatorBinding(RelDataTypeFactory typeFactory, SqlOperator sqlOperator)
typeFactory - Type factorysqlOperator - Operator which is subject of this callpublic int getGroupCount()
Returns 0 if the query is implicitly "GROUP BY ()" because of an aggregate expression. For example, "SELECT sum(sal) FROM emp".
Returns -1 if the query is not an aggregate query.
public boolean hasFilter()
public SqlOperator getOperator()
public RelDataTypeFactory getTypeFactory()
@Deprecated public @Nullable String getStringLiteralOperand(int ordinal)
ordinal - zero-based ordinal of operand of interest@Deprecated public int getIntLiteralOperand(int ordinal)
ordinal - zero-based ordinal of operand of interestpublic <T> T getOperandLiteralValue(int ordinal,
Class<T> clazz)
Cases:
NlsString.
BigDecimal.
SqlIntervalQualifierordinal - zero-based ordinal of operand of interestclazz - Desired valued typepublic @Nullable Object getOperandLiteralValue(int ordinal, RelDataType type)
ordinal - zero-based ordinal of operand of interesttype - Desired valued type@Deprecated public @Nullable Comparable getOperandLiteralValue(int ordinal)
public boolean isOperandNull(int ordinal,
boolean allowCast)
This is only relevant for SQL validation.
ordinal - zero-based ordinal of operand of interestallowCast - whether to regard CAST(constant) as a constantpublic boolean isOperandLiteral(int ordinal,
boolean allowCast)
ordinal - zero-based ordinal of operand of interestallowCast - whether to regard CAST(literal) as a literalpublic abstract int getOperandCount()
public abstract RelDataType getOperandType(int ordinal)
ordinal - zero-based ordinal of operand of interestpublic SqlMonotonicity getOperandMonotonicity(int ordinal)
ordinal - zero-based ordinal of operand of interestpublic List<RelDataType> collectOperandTypes()
public @Nullable RelDataType getCursorOperand(int ordinal)
ordinalth operand, which is a
cursor.
This is only implemented for SqlCallBinding.
ordinal - Ordinal of the operandpublic @Nullable String getColumnListParamInfo(int ordinal, String paramName, List<String> columnList)
ordinal - ordinal position of the column list parameterparamName - name of the column list parametercolumnList - returns a list of the column names that are referenced
in the column list parameterpublic abstract CalciteException newError(org.apache.calcite.runtime.Resources.ExInst<SqlValidatorException> e)
e - Validation error, not nullCopyright © 2012-2022 Apache Software Foundation. All Rights Reserved.