Package org.apache.calcite.sql.validate
Class SelectNamespace
- java.lang.Object
-
- org.apache.calcite.sql.validate.AbstractNamespace
-
- org.apache.calcite.sql.validate.SelectNamespace
-
- All Implemented Interfaces:
SqlValidatorNamespace
public class SelectNamespace extends AbstractNamespace
Namespace offered by a sub-query.- See Also:
SelectScope
,SetopNamespace
-
-
Field Summary
Fields Modifier and Type Field Description private SqlSelect
select
-
Fields inherited from class org.apache.calcite.sql.validate.AbstractNamespace
enclosingNode, rowType, type, validator
-
-
Constructor Summary
Constructors Constructor Description SelectNamespace(SqlValidatorImpl validator, SqlSelect select, SqlNode enclosingNode)
Creates a SelectNamespace.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SqlMonotonicity
getMonotonicity(java.lang.String columnName)
Returns whether and how a given column is sorted.SqlSelect
getNode()
Returns the parse tree node at the root of this namespace.boolean
supportsModality(SqlModality modality)
Returns whether this namespace is capable of giving results of the desired modality.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, toStruct, translate, unwrap, validate
-
-
-
-
Field Detail
-
select
private final SqlSelect select
-
-
Constructor Detail
-
SelectNamespace
public SelectNamespace(SqlValidatorImpl validator, SqlSelect select, SqlNode enclosingNode)
Creates a SelectNamespace.- Parameters:
validator
- Validateselect
- Select nodeenclosingNode
- Enclosing node
-
-
Method Detail
-
getNode
public SqlSelect getNode()
Description copied from interface:SqlValidatorNamespace
Returns the parse tree node at the root of this namespace.- Returns:
- parse tree node; null for
TableNamespace
-
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
-
supportsModality
public boolean supportsModality(SqlModality modality)
Description copied from interface:SqlValidatorNamespace
Returns whether this namespace is capable of giving results of the desired modality.true
means streaming,false
means relational.- Specified by:
supportsModality
in interfaceSqlValidatorNamespace
- Overrides:
supportsModality
in classAbstractNamespace
- Parameters:
modality
- Modality
-
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
-
-