Package org.apache.calcite.sql.type
Interface SqlOperandTypeChecker
-
- All Known Subinterfaces:
SqlSingleOperandTypeChecker
- All Known Implementing Classes:
AssignableOperandTypeChecker
,ComparableOperandTypeChecker
,CompositeOperandTypeChecker
,CompositeSingleOperandTypeChecker
,FamilyOperandTypeChecker
,LiteralOperandTypeChecker
,MultisetOperandTypeChecker
,OperandTypes.PeriodOperandTypeChecker
,SameOperandTypeChecker
,SameOperandTypeExceptLastOperandChecker
,SetopOperandTypeChecker
public interface SqlOperandTypeChecker
Strategy interface to check for allowed operand types of an operator call.This interface is an example of the
strategy pattern
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SqlOperandTypeChecker.Consistency
Strategy used to make arguments consistent.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
checkOperandTypes(SqlCallBinding callBinding, boolean throwOnFailure)
Checks the types of all operands to an operator call.java.lang.String
getAllowedSignatures(SqlOperator op, java.lang.String opName)
Returns a string describing the allowed formal signatures of a call, e.g.SqlOperandTypeChecker.Consistency
getConsistency()
Returns the strategy for making the arguments have consistency types.SqlOperandCountRange
getOperandCountRange()
boolean
isOptional(int i)
Returns whether thei
th operand is optional.
-
-
-
Method Detail
-
checkOperandTypes
boolean checkOperandTypes(SqlCallBinding callBinding, boolean throwOnFailure)
Checks the types of all operands to an operator call.- 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
-
getOperandCountRange
SqlOperandCountRange getOperandCountRange()
- Returns:
- range of operand counts allowed in a call
-
getAllowedSignatures
java.lang.String getAllowedSignatures(SqlOperator op, java.lang.String opName)
Returns a string describing the allowed formal signatures of a call, e.g. "SUBSTR(VARCHAR, INTEGER, INTEGER)".- Parameters:
op
- the operator being checkedopName
- name to use for the operator in case of aliasing- Returns:
- generated string
-
getConsistency
SqlOperandTypeChecker.Consistency getConsistency()
Returns the strategy for making the arguments have consistency types.
-
isOptional
boolean isOptional(int i)
Returns whether thei
th operand is optional.
-
-