Package org.apache.calcite.sql.type
Interface SqlOperandTypeChecker
- All Known Subinterfaces:
- SqlOperandMetadata,- SqlSingleOperandTypeChecker
- All Known Implementing Classes:
- ArrayElementOperandTypeChecker,- ArrayInsertOperandTypeChecker,- AssignableOperandTypeChecker,- ComparableOperandTypeChecker,- CompositeOperandTypeChecker,- CompositeSingleOperandTypeChecker,- ExplicitOperandTypeChecker,- FamilyOperandTypeChecker,- IntervalOperandTypeChecker,- LiteralOperandTypeChecker,- MultisetOperandTypeChecker,- NotNullOperandTypeChecker,- OperandMetadataImpl,- SameOperandTypeChecker,- SameOperandTypeExceptLastOperandChecker,- SetopOperandTypeChecker,- SqlWindowTableFunction.AbstractOperandMetadata
public interface SqlOperandTypeChecker
Strategy interface to check for allowed operand types of an operator call.
 
This interface is an example of the
 strategy pattern.
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic enumStrategy used to make arguments consistent.
- 
Method SummaryModifier and TypeMethodDescriptiondefault SqlOperandTypeCheckerand(SqlOperandTypeChecker checker) Composes this with another checker using AND.booleancheckOperandTypes(SqlCallBinding callBinding, boolean throwOnFailure) Checks the types of all operands to an operator call.getAllowedSignatures(SqlOperator op, String opName) Returns a string describing the allowed formal signatures of a call, e.g.Returns the strategy for making the arguments have consistency types.Returns the range of operand counts allowed in a call.default booleanReturns whether the list of parameters is fixed-length.default booleanisOptional(int i) Returns whether theith operand is optional.default SqlOperandTypeCheckeror(SqlOperandTypeChecker checker) Composes this with another checker using OR.default @Nullable SqlOperandTypeInferenceConverts this type checker to a type inference; returns null if not possible.default CompositeOperandTypeCheckerwithGenerator(BiFunction<SqlOperator, String, String> signatureGenerator) Returns a copy of this checker with the given signature generator.
- 
Method Details- 
checkOperandTypesChecks the types of all operands to an operator call.- Parameters:
- callBinding- description of the call to be checked
- throwOnFailure- whether to throw an exception if check fails (otherwise returns false in that case)
- Returns:
- whether check succeeded
 
- 
getOperandCountRangeSqlOperandCountRange getOperandCountRange()Returns the range of operand counts allowed in a call.
- 
getAllowedSignaturesReturns a string describing the allowed formal signatures of a call, e.g. "SUBSTR(VARCHAR, INTEGER, INTEGER)".- Parameters:
- op- the operator being checked
- opName- name to use for the operator in case of aliasing
- Returns:
- generated string
 
- 
getConsistencyReturns the strategy for making the arguments have consistency types.
- 
withGeneratordefault CompositeOperandTypeChecker withGenerator(BiFunction<SqlOperator, String, String> signatureGenerator) Returns a copy of this checker with the given signature generator.
- 
isOptionaldefault boolean isOptional(int i) Returns whether theith operand is optional.
- 
isFixedParametersdefault boolean isFixedParameters()Returns whether the list of parameters is fixed-length. In standard SQL, user-defined functions are fixed-length.If true, the validator should expand calls, supplying a DEFAULTvalue for each parameter for which an argument is not supplied.
- 
typeInferenceConverts this type checker to a type inference; returns null if not possible.
- 
andComposes this with another checker using AND.
- 
orComposes this with another checker using OR.
 
-