Package org.apache.calcite.sql
Class ExplicitOperatorBinding
- java.lang.Object
-
- org.apache.calcite.sql.SqlOperatorBinding
-
- org.apache.calcite.sql.ExplicitOperatorBinding
-
public class ExplicitOperatorBinding extends SqlOperatorBinding
ExplicitOperatorBinding
implementsSqlOperatorBinding
via an underlying array of known operand types.
-
-
Field Summary
Fields Modifier and Type Field Description private SqlOperatorBinding
delegate
private java.util.List<RelDataType>
types
-
Fields inherited from class org.apache.calcite.sql.SqlOperatorBinding
typeFactory
-
-
Constructor Summary
Constructors Modifier Constructor Description ExplicitOperatorBinding(RelDataTypeFactory typeFactory, SqlOperator operator, java.util.List<RelDataType> types)
ExplicitOperatorBinding(SqlOperatorBinding delegate, java.util.List<RelDataType> types)
private
ExplicitOperatorBinding(SqlOperatorBinding delegate, RelDataTypeFactory typeFactory, SqlOperator operator, java.util.List<RelDataType> types)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getOperandCount()
RelDataType
getOperandType(int ordinal)
Gets the type of a bound operand.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.-
Methods inherited from class org.apache.calcite.sql.SqlOperatorBinding
collectOperandTypes, getColumnListParamInfo, getCursorOperand, getGroupCount, getIntLiteralOperand, getOperandLiteralValue, getOperandLiteralValue, getOperandMonotonicity, getOperator, getStringLiteralOperand, getTypeFactory, hasFilter, isOperandLiteral
-
-
-
-
Field Detail
-
types
private final java.util.List<RelDataType> types
-
delegate
private final SqlOperatorBinding delegate
-
-
Constructor Detail
-
ExplicitOperatorBinding
public ExplicitOperatorBinding(SqlOperatorBinding delegate, java.util.List<RelDataType> types)
-
ExplicitOperatorBinding
public ExplicitOperatorBinding(RelDataTypeFactory typeFactory, SqlOperator operator, java.util.List<RelDataType> types)
-
ExplicitOperatorBinding
private ExplicitOperatorBinding(SqlOperatorBinding delegate, RelDataTypeFactory typeFactory, SqlOperator operator, java.util.List<RelDataType> types)
-
-
Method Detail
-
getOperandCount
public int getOperandCount()
- Specified by:
getOperandCount
in classSqlOperatorBinding
- Returns:
- the number of bound operands
-
getOperandType
public RelDataType getOperandType(int ordinal)
Description copied from class:SqlOperatorBinding
Gets the type of a bound operand.- Specified by:
getOperandType
in classSqlOperatorBinding
- Parameters:
ordinal
- zero-based ordinal of operand of interest- Returns:
- bound operand type
-
newError
public CalciteException newError(Resources.ExInst<SqlValidatorException> e)
Description copied from class:SqlOperatorBinding
Wraps a validation error with context appropriate to this operator call.- Specified by:
newError
in classSqlOperatorBinding
- Parameters:
e
- Validation error, not null- Returns:
- Error wrapped, if possible, with positional information
-
isOperandNull
public boolean isOperandNull(int ordinal, boolean allowCast)
Description copied from class:SqlOperatorBinding
Determines whether a bound operand is NULL.This is only relevant for SQL validation.
- Overrides:
isOperandNull
in classSqlOperatorBinding
- Parameters:
ordinal
- zero-based ordinal of operand of interestallowCast
- whether to regard CAST(constant) as a constant- Returns:
- whether operand is null; false for everything except SQL validation
-
-