public abstract class DelegatingNamespace extends java.lang.Object implements SqlValidatorNamespace
SqlValidatorNamespace
that delegates all methods
to an underlying object.Modifier and Type | Field and Description |
---|---|
protected SqlValidatorNamespace |
namespace |
Modifier | Constructor and Description |
---|---|
protected |
DelegatingNamespace(SqlValidatorNamespace namespace)
Creates a DelegatingNamespace.
|
Modifier and Type | Method and Description |
---|---|
boolean |
fieldExists(java.lang.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.
|
java.util.List<Pair<SqlNode,SqlMonotonicity>> |
getMonotonicExprs()
Returns a list of expressions which are monotonic in this namespace.
|
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 |
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.
|
SqlValidatorTable |
getTable()
Returns the underlying table, or null if there is none.
|
RelDataType |
getType()
Returns the type of this namespace.
|
SqlValidator |
getValidator()
Returns the validator.
|
boolean |
isWrapperFor(java.lang.Class<?> clazz)
Returns whether this namespace implements a given interface, or wraps a
class which does.
|
SqlValidatorNamespace |
lookupChild(java.lang.String name)
Looks up a child namespace of a given name.
|
void |
makeNullable() |
void |
setType(RelDataType type)
Sets the type of this namespace.
|
<T> T |
unwrap(java.lang.Class<T> clazz)
Returns this namespace, or a wrapped namespace, cast to a particular
class.
|
void |
validate(RelDataType targetRowType)
Validates this namespace.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
resolve, supportsModality
protected final SqlValidatorNamespace namespace
protected DelegatingNamespace(SqlValidatorNamespace namespace)
namespace
- Underlying namespace, to delegate topublic SqlValidator getValidator()
SqlValidatorNamespace
getValidator
in interface SqlValidatorNamespace
public SqlValidatorTable getTable()
SqlValidatorNamespace
getTable
in interface SqlValidatorNamespace
public RelDataType getRowType()
SqlValidatorNamespace
getRowType
in interface SqlValidatorNamespace
public void setType(RelDataType type)
SqlValidatorNamespace
Allows the type for the namespace to be explicitly set, but usually is
called during SqlValidatorNamespace.validate(RelDataType)
.
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 SqlValidatorNamespace
public RelDataType getRowTypeSansSystemColumns()
SqlValidatorNamespace
getRowTypeSansSystemColumns
in interface SqlValidatorNamespace
public RelDataType getType()
SqlValidatorNamespace
getType
in interface SqlValidatorNamespace
public void validate(RelDataType targetRowType)
SqlValidatorNamespace
If the scope has already been validated, does nothing.
Please call SqlValidatorImpl.validateNamespace(org.apache.calcite.sql.validate.SqlValidatorNamespace, org.apache.calcite.rel.type.RelDataType)
rather than
calling this method directly.
validate
in interface SqlValidatorNamespace
targetRowType
- Desired row type, must not be null, may be the data
type 'unknown'.public SqlNode getNode()
SqlValidatorNamespace
getNode
in interface SqlValidatorNamespace
TableNamespace
public SqlNode getEnclosingNode()
SqlValidatorNamespace
SqlValidatorNamespace.getNode()
.getEnclosingNode
in interface SqlValidatorNamespace
public SqlValidatorNamespace lookupChild(java.lang.String name)
SqlValidatorNamespace
For 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 SqlValidatorNamespace
name
- Name of namespacepublic boolean fieldExists(java.lang.String name)
SqlValidatorNamespace
fieldExists
in interface SqlValidatorNamespace
name
- Field namepublic java.util.List<Pair<SqlNode,SqlMonotonicity>> getMonotonicExprs()
SqlValidatorNamespace
SqlIdentifier
called "TIMESTAMP".getMonotonicExprs
in interface SqlValidatorNamespace
public SqlMonotonicity getMonotonicity(java.lang.String columnName)
SqlValidatorNamespace
getMonotonicity
in interface SqlValidatorNamespace
public void makeNullable()
makeNullable
in interface SqlValidatorNamespace
public <T> T unwrap(java.lang.Class<T> clazz)
SqlValidatorNamespace
unwrap
in interface SqlValidatorNamespace
clazz
- Desired typepublic boolean isWrapperFor(java.lang.Class<?> clazz)
SqlValidatorNamespace
isWrapperFor
in interface SqlValidatorNamespace
clazz
- InterfaceCopyright © 2012–2019 The Apache Software Foundation. All rights reserved.