Package org.apache.calcite.sql.validate
Class SetopNamespace
- java.lang.Object
-
- org.apache.calcite.sql.validate.AbstractNamespace
-
- org.apache.calcite.sql.validate.SetopNamespace
-
- All Implemented Interfaces:
SqlValidatorNamespace
public class SetopNamespace extends AbstractNamespace
Namespace based upon a set operation (UNION, INTERSECT, EXCEPT).
-
-
Field Summary
Fields Modifier and Type Field Description private SqlCall
call
-
Fields inherited from class org.apache.calcite.sql.validate.AbstractNamespace
enclosingNode, rowType, type, validator
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SetopNamespace(SqlValidatorImpl validator, SqlCall call, SqlNode enclosingNode)
Creates aSetopNamespace
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private SqlMonotonicity
combine(SqlMonotonicity m0, SqlMonotonicity m1)
SqlMonotonicity
getMonotonicity(java.lang.String columnName)
Returns whether and how a given column is sorted.SqlNode
getNode()
Returns the parse tree node at the root of this namespace.RelDataType
validateImpl(RelDataType targetRowType)
Validates this scope and returns the type of the records it returns.-
Methods inherited from class org.apache.calcite.sql.validate.AbstractNamespace
convertToStruct, fieldExists, getEnclosingNode, getMonotonicExprs, getRowType, getRowTypeSansSystemColumns, getTable, getType, getValidator, isWrapperFor, lookupChild, makeNullable, resolve, setType, supportsModality, toStruct, translate, unwrap, validate
-
-
-
-
Field Detail
-
call
private final SqlCall call
-
-
Constructor Detail
-
SetopNamespace
protected SetopNamespace(SqlValidatorImpl validator, SqlCall call, SqlNode enclosingNode)
Creates aSetopNamespace
.- Parameters:
validator
- Validatorcall
- Call to set operatorenclosingNode
- Enclosing node
-
-
Method Detail
-
getNode
public SqlNode getNode()
Description copied from interface:SqlValidatorNamespace
Returns the parse tree node at the root of this namespace.- Returns:
- parse tree node; null for
TableNamespace
-
getMonotonicity
public SqlMonotonicity getMonotonicity(java.lang.String columnName)
Description copied from interface:SqlValidatorNamespace
Returns whether and how a given column is sorted.- Specified by:
getMonotonicity
in interfaceSqlValidatorNamespace
- Overrides:
getMonotonicity
in classAbstractNamespace
-
combine
private SqlMonotonicity combine(SqlMonotonicity m0, SqlMonotonicity m1)
-
validateImpl
public RelDataType validateImpl(RelDataType targetRowType)
Description copied from class:AbstractNamespace
Validates this scope and returns the type of the records it returns. External users should callAbstractNamespace.validate(org.apache.calcite.rel.type.RelDataType)
, which uses theAbstractNamespace.status
field to protect against cycles.- Specified by:
validateImpl
in classAbstractNamespace
- Parameters:
targetRowType
- Desired row type, must not be null, may be the data type 'unknown'.- Returns:
- record data type, never null
-
-