Package org.apache.calcite.sql.validate
Class AliasNamespace
- java.lang.Object
-
- org.apache.calcite.sql.validate.AbstractNamespace
-
- org.apache.calcite.sql.validate.AliasNamespace
-
- All Implemented Interfaces:
SqlValidatorNamespace
public class AliasNamespace extends AbstractNamespace
Namespace for anAS t(c1, c2, ...)
clause.A namespace is necessary only if there is a column list, in order to re-map column names; a
relation AS t
clause just uses the same namespace asrelation
.
-
-
Field Summary
Fields Modifier and Type Field Description protected SqlCall
call
-
Fields inherited from class org.apache.calcite.sql.validate.AbstractNamespace
enclosingNode, rowType, type, validator
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AliasNamespace(SqlValidatorImpl validator, SqlCall call, SqlNode enclosingNode)
Creates an AliasNamespace.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SqlNode
getNode()
Returns the parse tree node at the root of this namespace.private java.lang.String
getString(RelDataType rowType)
java.lang.String
translate(java.lang.String name)
protected 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, getMonotonicity, getRowType, getRowTypeSansSystemColumns, getTable, getType, getValidator, isWrapperFor, lookupChild, makeNullable, resolve, setType, supportsModality, toStruct, unwrap, validate
-
-
-
-
Field Detail
-
call
protected final SqlCall call
-
-
Constructor Detail
-
AliasNamespace
protected AliasNamespace(SqlValidatorImpl validator, SqlCall call, SqlNode enclosingNode)
Creates an AliasNamespace.- Parameters:
validator
- Validatorcall
- Call to AS operatorenclosingNode
- Enclosing node
-
-
Method Detail
-
validateImpl
protected 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
-
getString
private java.lang.String getString(RelDataType rowType)
-
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
-
translate
public java.lang.String translate(java.lang.String name)
- Overrides:
translate
in classAbstractNamespace
-
-