public abstract class SqlOperatorBinding
extends java.lang.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 |
---|---|
private SqlOperator |
sqlOperator |
protected RelDataTypeFactory |
typeFactory |
Modifier | Constructor and Description |
---|---|
protected |
SqlOperatorBinding(RelDataTypeFactory typeFactory,
SqlOperator sqlOperator)
Creates a SqlOperatorBinding.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<RelDataType> |
collectOperandTypes()
Collects the types of the bound operands into a list.
|
java.lang.String |
getColumnListParamInfo(int ordinal,
java.lang.String paramName,
java.util.List<java.lang.String> columnList)
Retrieves information about a column list parameter.
|
RelDataType |
getCursorOperand(int ordinal)
Returns the rowtype of the
ordinal th 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() |
java.lang.Comparable |
getOperandLiteralValue(int ordinal)
Deprecated.
|
<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.
|
abstract RelDataType |
getOperandType(int ordinal)
Gets the type of a bound operand.
|
SqlOperator |
getOperator() |
java.lang.String |
getStringLiteralOperand(int ordinal)
Deprecated.
|
RelDataTypeFactory |
getTypeFactory() |
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(Resources.ExInst<SqlValidatorException> e)
Wraps a validation error with context appropriate to this operator call.
|
protected final RelDataTypeFactory typeFactory
private final SqlOperator sqlOperator
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 java.lang.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, java.lang.Class<T> clazz)
Cases:
NlsString
.
BigDecimal
.
SqlIntervalQualifier
ordinal
- zero-based ordinal of operand of interestclazz
- Desired valued type@Deprecated public java.lang.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 java.util.List<RelDataType> collectOperandTypes()
public RelDataType getCursorOperand(int ordinal)
ordinal
th operand, which is a
cursor.
This is only implemented for SqlCallBinding
.
ordinal
- Ordinal of the operandpublic java.lang.String getColumnListParamInfo(int ordinal, java.lang.String paramName, java.util.List<java.lang.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(Resources.ExInst<SqlValidatorException> e)
e
- Validation error, not nullCopyright © 2012–2019 The Apache Software Foundation. All rights reserved.