Package org.apache.calcite.sql.type
Class ComparableOperandTypeChecker
- java.lang.Object
-
- org.apache.calcite.sql.type.SameOperandTypeChecker
-
- org.apache.calcite.sql.type.ComparableOperandTypeChecker
-
- All Implemented Interfaces:
SqlOperandTypeChecker
,SqlSingleOperandTypeChecker
public class ComparableOperandTypeChecker extends SameOperandTypeChecker
Type checking strategy which verifies that types have the required attributes to be used as arguments to comparison operators.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.calcite.sql.type.SqlOperandTypeChecker
SqlOperandTypeChecker.Consistency
-
-
Field Summary
Fields Modifier and Type Field Description private SqlOperandTypeChecker.Consistency
consistency
private RelDataTypeComparability
requiredComparability
-
Fields inherited from class org.apache.calcite.sql.type.SameOperandTypeChecker
nOperands
-
-
Constructor Summary
Constructors Constructor Description ComparableOperandTypeChecker(int nOperands, RelDataTypeComparability requiredComparability)
Deprecated.ComparableOperandTypeChecker(int nOperands, RelDataTypeComparability requiredComparability, SqlOperandTypeChecker.Consistency consistency)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkOperandTypes(SqlCallBinding callBinding, boolean throwOnFailure)
Checks the types of all operands to an operator call.boolean
checkOperandTypes(SqlOperatorBinding callBinding)
Similar functionality tocheckOperandTypes(SqlCallBinding, boolean)
, but not part of the interface, and cannot throw an error.private boolean
checkType(SqlCallBinding callBinding, boolean throwOnFailure, RelDataType type)
SqlOperandTypeChecker.Consistency
getConsistency()
Returns the strategy for making the arguments have consistency types.protected java.lang.String
getTypeName()
Override to change the behavior ofSameOperandTypeChecker.getAllowedSignatures(SqlOperator, String)
.-
Methods inherited from class org.apache.calcite.sql.type.SameOperandTypeChecker
checkOperandTypesImpl, checkSingleOperandType, getAllowedSignatures, getOperandCountRange, getOperandList, isOptional
-
-
-
-
Field Detail
-
requiredComparability
private final RelDataTypeComparability requiredComparability
-
consistency
private final SqlOperandTypeChecker.Consistency consistency
-
-
Constructor Detail
-
ComparableOperandTypeChecker
@Deprecated public ComparableOperandTypeChecker(int nOperands, RelDataTypeComparability requiredComparability)
Deprecated.
-
ComparableOperandTypeChecker
public ComparableOperandTypeChecker(int nOperands, RelDataTypeComparability requiredComparability, SqlOperandTypeChecker.Consistency consistency)
-
-
Method Detail
-
checkOperandTypes
public boolean checkOperandTypes(SqlCallBinding callBinding, boolean throwOnFailure)
Description copied from interface:SqlOperandTypeChecker
Checks the types of all operands to an operator call.- Specified by:
checkOperandTypes
in interfaceSqlOperandTypeChecker
- Overrides:
checkOperandTypes
in classSameOperandTypeChecker
- Parameters:
callBinding
- description of the call to be checkedthrowOnFailure
- whether to throw an exception if check fails (otherwise returns false in that case)- Returns:
- whether check succeeded
-
checkType
private boolean checkType(SqlCallBinding callBinding, boolean throwOnFailure, RelDataType type)
-
checkOperandTypes
public boolean checkOperandTypes(SqlOperatorBinding callBinding)
Similar functionality tocheckOperandTypes(SqlCallBinding, boolean)
, but not part of the interface, and cannot throw an error.- Overrides:
checkOperandTypes
in classSameOperandTypeChecker
-
getTypeName
protected java.lang.String getTypeName()
Description copied from class:SameOperandTypeChecker
Override to change the behavior ofSameOperandTypeChecker.getAllowedSignatures(SqlOperator, String)
.- Overrides:
getTypeName
in classSameOperandTypeChecker
-
getConsistency
public SqlOperandTypeChecker.Consistency getConsistency()
Description copied from interface:SqlOperandTypeChecker
Returns the strategy for making the arguments have consistency types.- Specified by:
getConsistency
in interfaceSqlOperandTypeChecker
- Overrides:
getConsistency
in classSameOperandTypeChecker
-
-