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.
|
String |
getColumnListParamInfo(int ordinal,
String paramName,
List<String> columnList)
Retrieves information about a column list parameter.
|
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)
Gets the integer value of a numeric literal operand.
|
abstract int |
getOperandCount() |
abstract RelDataType |
getOperandType(int ordinal)
Gets the type of a bound operand.
|
SqlOperator |
getOperator() |
String |
getStringLiteralOperand(int ordinal)
Gets the string value of a string literal operand.
|
RelDataTypeFactory |
getTypeFactory() |
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
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 SqlOperator getOperator()
public RelDataTypeFactory getTypeFactory()
public String getStringLiteralOperand(int ordinal)
ordinal - zero-based ordinal of operand of interestpublic int getIntLiteralOperand(int ordinal)
ordinal - zero-based ordinal of operand of interestpublic 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 abstract int getOperandCount()
public abstract RelDataType getOperandType(int ordinal)
ordinal - zero-based ordinal of operand of interestpublic List<RelDataType> collectOperandTypes()
public RelDataType getCursorOperand(int ordinal)
ordinalth operand, which is a
cursor.
This is only implemented for SqlCallBinding.
ordinal - Ordinal of the operandpublic 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(Resources.ExInst<SqlValidatorException> e)
e - Validation error, not nullCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.