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
-
public class SqlSetOperator extends SqlBinaryOperator
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 Modifier and Type Field Description private boolean
all
-
Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL
-
-
Constructor Summary
Constructors Constructor Description SqlSetOperator(java.lang.String name, SqlKind kind, int prec, boolean all)
SqlSetOperator(java.lang.String name, SqlKind kind, int prec, boolean all, SqlReturnTypeInference returnTypeInference, SqlOperandTypeInference operandTypeInference, SqlOperandTypeChecker operandTypeChecker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isAll()
boolean
isDistinct()
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, needsSpace, validRexOperands
-
Methods inherited from class org.apache.calcite.sql.SqlOperator
acceptCall, acceptCall, allowsFraming, argumentMustBeScalar, 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, validateOperands
-
-
-
-
Constructor Detail
-
SqlSetOperator
public SqlSetOperator(java.lang.String name, SqlKind kind, int prec, boolean all)
-
SqlSetOperator
public SqlSetOperator(java.lang.String name, SqlKind kind, int prec, boolean all, SqlReturnTypeInference returnTypeInference, SqlOperandTypeInference operandTypeInference, SqlOperandTypeChecker operandTypeChecker)
-
-
Method Detail
-
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:
SqlNode.validateExpr(SqlValidator, SqlValidatorScope)
,SqlOperator.deriveType(SqlValidator, SqlValidatorScope, SqlCall)
-
-