org.eigenbase.sql.type
Class SqlReturnTypeInferenceChain
java.lang.Object
org.eigenbase.sql.type.SqlReturnTypeInferenceChain
- All Implemented Interfaces:
- SqlReturnTypeInference
public class SqlReturnTypeInferenceChain
- extends Object
- implements SqlReturnTypeInference
Strategy to infer the type of an operator call from the type of the operands
by using a series of SqlReturnTypeInference
rules in a given order.
If a rule fails to find a return type (by returning NULL), next rule is tried
until there are no more rules in which case NULL will be returned.
- Version:
- $Id: //open/dev/farrago/src/org/eigenbase/sql/type/SqlReturnTypeInferenceChain.java#6 $
- Author:
- Wael Chatila
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
rules
private final SqlReturnTypeInference[] rules
SqlReturnTypeInferenceChain
public SqlReturnTypeInferenceChain(SqlReturnTypeInference[] rules)
- Creates a FallbackCascade from an array of rules
- "Precondition:"
- null!=rules, null!=rules[i], rules.length > 0
SqlReturnTypeInferenceChain
public SqlReturnTypeInferenceChain(SqlReturnTypeInference rule1,
SqlReturnTypeInference rule2)
- Creates a FallbackCascade from two rules
inferReturnType
public RelDataType inferReturnType(SqlOperatorBinding opBinding)
- Description copied from interface:
SqlReturnTypeInference
- Infers the return type of a call to an
SqlOperator
.
- Specified by:
inferReturnType
in interface SqlReturnTypeInference
- Parameters:
opBinding
- description of operator binding
- Returns:
- inferred type