Package org.apache.calcite.sql.validate
Class TableConstructorNamespace
- java.lang.Object
-
- org.apache.calcite.sql.validate.AbstractNamespace
-
- org.apache.calcite.sql.validate.TableConstructorNamespace
-
- All Implemented Interfaces:
SqlValidatorNamespace
public class TableConstructorNamespace extends AbstractNamespace
Namespace for a table constructorVALUES (expr, expr, ...)
.
-
-
Field Summary
Fields Modifier and Type Field Description private SqlValidatorScope
scope
private SqlCall
values
-
Fields inherited from class org.apache.calcite.sql.validate.AbstractNamespace
enclosingNode, rowType, type, validator
-
-
Constructor Summary
Constructors Constructor Description TableConstructorNamespace(SqlValidatorImpl validator, SqlCall values, SqlValidatorScope scope, SqlNode enclosingNode)
Creates a TableConstructorNamespace.
-
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.SqlValidatorScope
getScope()
Returns the scope.boolean
supportsModality(SqlModality modality)
Returns whether this namespace is capable of giving results of the desired modality.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, toStruct, translate, unwrap, validate
-
-
-
-
Field Detail
-
values
private final SqlCall values
-
scope
private final SqlValidatorScope scope
-
-
Constructor Detail
-
TableConstructorNamespace
TableConstructorNamespace(SqlValidatorImpl validator, SqlCall values, SqlValidatorScope scope, SqlNode enclosingNode)
Creates a TableConstructorNamespace.- Parameters:
validator
- Validatorvalues
- VALUES parse tree nodescope
- ScopeenclosingNode
- 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
-
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
-
getScope
public SqlValidatorScope getScope()
Returns the scope.- Returns:
- scope
-
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
-
-