Package org.apache.calcite.sql
Class SqlSetOperator
java.lang.Object
org.apache.calcite.sql.SqlOperator
org.apache.calcite.sql.SqlBinaryOperator
org.apache.calcite.sql.SqlSetOperator
SqlSetOperator represents a relational set theory operator (UNION, INTERSECT,
MINUS). These are binary operators, but with an extra boolean attribute
tacked on for whether to remove duplicates (e.g. UNION ALL does not remove
duplicates).
-
Field Summary
Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL
-
Constructor Summary
ConstructorDescriptionSqlSetOperator
(String name, SqlKind kind, int prec, boolean all) SqlSetOperator
(String name, SqlKind kind, int prec, boolean all, SqlReturnTypeInference returnTypeInference, SqlOperandTypeInference operandTypeInference, SqlOperandTypeChecker operandTypeChecker) -
Method Summary
Modifier and TypeMethodDescriptionboolean
isAll()
boolean
void
validateCall
(SqlCall call, SqlValidator validator, SqlValidatorScope scope, SqlValidatorScope operandScope) Validates a call to this operator.Methods inherited from class org.apache.calcite.sql.SqlBinaryOperator
adjustType, deriveType, getMonotonicity, getSignatureTemplate, getSyntax, reverse, validRexOperands
Methods inherited from class org.apache.calcite.sql.SqlOperator
acceptCall, acceptCall, allowsFraming, argumentMustBeScalar, checkOperandCount, checkOperandTypes, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, createCall, createCall, createCall, deriveOperandType, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getName, getNameAsId, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getStrongPolicyInference, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, not, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, rewriteCall, rightPrec, toString, unparse, unparseListClause, unparseListClause, validateOperands
-
Constructor Details
-
SqlSetOperator
-
SqlSetOperator
public SqlSetOperator(String name, SqlKind kind, int prec, boolean all, SqlReturnTypeInference returnTypeInference, SqlOperandTypeInference operandTypeInference, SqlOperandTypeChecker operandTypeChecker)
-
-
Method Details
-
isAll
public boolean isAll() -
isDistinct
public boolean isDistinct() -
validateCall
public void validateCall(SqlCall call, SqlValidator validator, SqlValidatorScope scope, SqlValidatorScope operandScope) Description copied from class:SqlOperator
Validates a call to this operator.This method should not perform type-derivation or perform validation related related to types. That is done later, by
SqlOperator.deriveType(SqlValidator, SqlValidatorScope, SqlCall)
. This method should focus on structural validation.A typical implementation of this method first validates the operands, then performs some operator-specific logic. The default implementation just validates the operands.
This method is the default implementation of
SqlCall.validate(org.apache.calcite.sql.validate.SqlValidator, org.apache.calcite.sql.validate.SqlValidatorScope)
; but note that some sub-classes ofSqlCall
never call this method.- Overrides:
validateCall
in classSqlOperator
- Parameters:
call
- the call to this operatorvalidator
- the active validatorscope
- validator scopeoperandScope
- validator scope in which to validate operands to this call; usually equal to scope, but not always because some operators introduce new scopes- See Also:
-