org.eigenbase.sql.fun
Class SqlInOperator

java.lang.Object
  extended by org.eigenbase.sql.SqlOperator
      extended by org.eigenbase.sql.SqlBinaryOperator
          extended by org.eigenbase.sql.fun.SqlInOperator

public class SqlInOperator
extends SqlBinaryOperator

Definition of the SQL IN operator, which tests for a value's membership in a subquery or a list of values.

Since:
April 17, 2006
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/fun/SqlInOperator.java#12 $
Author:
jhyde

Field Summary
private  boolean isNotIn
          If true the call represents 'NOT IN'.
 
Fields inherited from class org.eigenbase.sql.SqlOperator
MaxPrec, NL
 
Constructor Summary
SqlInOperator(boolean isNotIn)
          Creates a SqlInOperator
 
Method Summary
 boolean argumentMustBeScalar(int ordinal)
          Returns whether the ordinalth argument to this operator must be scalar (as opposed to a query).
 RelDataType deriveType(SqlValidator validator, SqlValidatorScope scope, SqlCall call)
          Derives the type of a call to this operator.
 boolean isNotIn()
          Returns whether this is the 'NOT IN' operator
 
Methods inherited from class org.eigenbase.sql.SqlBinaryOperator
adjustType, getMonotonicity, getSignatureTemplate, getSyntax
 
Methods inherited from class org.eigenbase.sql.SqlOperator
acceptCall, acceptCall, checkOperandCount, checkOperandTypes, createCall, createCall, createCall, createCall, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getName, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isName, leftPrec, preValidateCall, requiresDecimalExpansion, rewriteCall, rightPrec, toString, unparse, unparseListClause, unparseListClause, validateCall, validateOperands
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

isNotIn

private final boolean isNotIn
If true the call represents 'NOT IN'.

Constructor Detail

SqlInOperator

SqlInOperator(boolean isNotIn)
Creates a SqlInOperator

Parameters:
isNotIn - Whether this is the 'NOT IN' operator
Method Detail

isNotIn

public boolean isNotIn()
Returns whether this is the 'NOT IN' operator

Returns:
whether this is the 'NOT IN' operator

deriveType

public RelDataType deriveType(SqlValidator validator,
                              SqlValidatorScope scope,
                              SqlCall call)
Description copied from class: SqlOperator
Derives the type of a call to this operator.

This method is an intrinsic part of the validation process so, unlike SqlOperator.inferReturnType(org.eigenbase.sql.SqlOperatorBinding), specific operators would not typically override this method.

Overrides:
deriveType in class SqlBinaryOperator
Parameters:
validator - Validator
scope - Scope of validation
call - Call to this operator
Returns:
Type of call

argumentMustBeScalar

public boolean argumentMustBeScalar(int ordinal)
Description copied from class: SqlOperator
Returns whether the ordinalth argument to this operator must be scalar (as opposed to a query).

If true (the default), the validator will attempt to convert the argument into a scalar subquery, which must have one column and return at most one row.

Operators such as SELECT and EXISTS override this method.

Overrides:
argumentMustBeScalar in class SqlOperator