Class SqlInOperator
- java.lang.Object
-
- org.apache.calcite.sql.SqlOperator
-
- org.apache.calcite.sql.SqlBinaryOperator
-
- org.apache.calcite.sql.fun.SqlInOperator
-
- Direct Known Subclasses:
SqlQuantifyOperator
public class SqlInOperator extends SqlBinaryOperator
Definition of the SQLIN
operator, which tests for a value's membership in a sub-query or a list of values.
-
-
Field Summary
-
Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SqlInOperator(java.lang.String name, SqlKind kind)
(package private)
SqlInOperator(SqlKind kind)
Creates a SqlInOperator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private static boolean
anyNullable(java.util.List<RelDataTypeField> fieldList)
boolean
argumentMustBeScalar(int ordinal)
Returns whether theordinal
th 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()
Deprecated.boolean
validRexOperands(int count, Litmus litmus)
Returns whether the given operands are valid.-
Methods inherited from class org.apache.calcite.sql.SqlBinaryOperator
adjustType, getMonotonicity, getSignatureTemplate, getSyntax
-
Methods inherited from class org.apache.calcite.sql.SqlOperator
acceptCall, acceptCall, allowsFraming, checkOperandCount, checkOperandTypes, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getName, getNameAsId, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, leftPrec, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, rewriteCall, rightPrec, toString, unparse, unparseListClause, unparseListClause, validateCall, validateOperands
-
-
-
-
Method Detail
-
isNotIn
@Deprecated public boolean isNotIn()
Deprecated.
-
validRexOperands
public boolean validRexOperands(int count, Litmus litmus)
Description copied from class:SqlOperator
Returns whether the given operands are valid. If not valid andfail
, throws an assertion error.Similar to
SqlOperator.checkOperandCount(org.apache.calcite.sql.validate.SqlValidator, org.apache.calcite.sql.type.SqlOperandTypeChecker, org.apache.calcite.sql.SqlCall)
, but some operators may have different valid operands inSqlNode
andRexNode
formats (some examples are CAST and AND), and this method throws internal errors, not user errors.- Overrides:
validRexOperands
in classSqlBinaryOperator
-
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.apache.calcite.sql.SqlOperatorBinding)
, specific operators would not typically override this method.- Overrides:
deriveType
in classSqlBinaryOperator
- Parameters:
validator
- Validatorscope
- Scope of validationcall
- Call to this operator- Returns:
- Type of call
-
anyNullable
private static boolean anyNullable(java.util.List<RelDataTypeField> fieldList)
-
argumentMustBeScalar
public boolean argumentMustBeScalar(int ordinal)
Description copied from class:SqlOperator
Returns whether theordinal
th 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 sub-query, which must have one column and return at most one row.
Operators such as
SELECT
andEXISTS
override this method.- Overrides:
argumentMustBeScalar
in classSqlOperator
-
-