public static class SqlValidatorImpl.DmlNamespace extends IdentifierNamespace
| Modifier and Type | Field and Description |
|---|---|
protected SqlNode |
enclosingNode |
protected RelDataType |
rowType
Type of the output row, which comprises the name and type of each output
column.
|
protected RelDataType |
type
As
rowType, but not necessarily a struct. |
protected SqlValidatorImpl |
validator |
| Modifier | Constructor and Description |
|---|---|
protected |
SqlValidatorImpl.DmlNamespace(SqlValidatorImpl validator,
SqlNode id,
SqlNode enclosingNode,
SqlValidatorScope parentScope) |
| Modifier and Type | Method and Description |
|---|---|
protected RelDataType |
convertToStruct(RelDataType type) |
boolean |
fieldExists(String name)
Returns whether this namespace has a field of a given name.
|
SqlNode |
getEnclosingNode()
Returns the parse tree node that at is at the root of this namespace and
includes all decorations.
|
RelDataType |
getRowType()
Returns the row type of this namespace, which comprises a list of names
and types of the output columns.
|
RelDataType |
getRowTypeSansSystemColumns()
Returns the row type of this namespace, sans any system columns.
|
RelDataType |
getType()
Returns the type of this namespace.
|
SqlValidator |
getValidator()
Returns the validator.
|
boolean |
isWrapperFor(Class<?> clazz)
Returns whether this namespace implements a given interface, or wraps a
class which does.
|
SqlValidatorNamespace |
lookupChild(String name)
Looks up a child namespace of a given name.
|
void |
makeNullable()
Makes all fields in this namespace nullable (typically because it is on
the outer side of an outer join.
|
void |
setType(RelDataType type)
Sets the type of this namespace.
|
<T> T |
unwrap(Class<T> clazz)
Returns this namespace, or a wrapped namespace, cast to a particular
class.
|
void |
validate()
Validates this namespace.
|
getId, getMonotonicExprs, getMonotonicity, getNode, getTable, resolve, split, supportsModality, translate, validateImplprotected final SqlValidatorImpl validator
protected RelDataType rowType
protected RelDataType type
rowType, but not necessarily a struct.protected final SqlNode enclosingNode
protected SqlValidatorImpl.DmlNamespace(SqlValidatorImpl validator, SqlNode id, SqlNode enclosingNode, SqlValidatorScope parentScope)
public SqlValidator getValidator()
SqlValidatorNamespacegetValidator in interface SqlValidatorNamespacepublic final void validate()
SqlValidatorNamespaceIf the scope has already been validated, does nothing.
Please call SqlValidatorImpl.validateNamespace(org.apache.calcite.sql.validate.SqlValidatorNamespace) rather than
calling this method directly.
validate in interface SqlValidatorNamespacepublic RelDataType getRowType()
SqlValidatorNamespacegetRowType in interface SqlValidatorNamespacepublic RelDataType getRowTypeSansSystemColumns()
SqlValidatorNamespacegetRowTypeSansSystemColumns in interface SqlValidatorNamespacepublic RelDataType getType()
SqlValidatorNamespacegetType in interface SqlValidatorNamespacepublic void setType(RelDataType type)
SqlValidatorNamespaceAllows the type for the namespace to be explicitly set, but usually is
called during SqlValidatorNamespace.validate().
Implicitly also sets the row type. If the type is not a struct, then the row type is the type wrapped as a struct with a single column, otherwise the type and row type are the same.
setType in interface SqlValidatorNamespacepublic SqlNode getEnclosingNode()
SqlValidatorNamespaceSqlValidatorNamespace.getNode().getEnclosingNode in interface SqlValidatorNamespacepublic SqlValidatorNamespace lookupChild(String name)
SqlValidatorNamespaceFor example, in the query select e.name from emps as e,
e is an IdentifierNamespace which has a child
name which is a FieldNamespace.
lookupChild in interface SqlValidatorNamespacename - Name of namespacepublic boolean fieldExists(String name)
SqlValidatorNamespacefieldExists in interface SqlValidatorNamespacename - Field namepublic void makeNullable()
SqlValidatorNamespacemakeNullable in interface SqlValidatorNamespacepublic <T> T unwrap(Class<T> clazz)
SqlValidatorNamespaceunwrap in interface SqlValidatorNamespaceclazz - Desired typepublic boolean isWrapperFor(Class<?> clazz)
SqlValidatorNamespaceisWrapperFor in interface SqlValidatorNamespaceclazz - Interfaceprotected RelDataType convertToStruct(RelDataType type)
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.