Package org.apache.calcite.sql.validate
Class DelegatingNamespace
java.lang.Object
org.apache.calcite.sql.validate.DelegatingNamespace
- All Implemented Interfaces:
SqlValidatorNamespace
An implementation of
SqlValidatorNamespace that delegates all methods
to an underlying object.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDelegatingNamespace(SqlValidatorNamespace namespace) Creates a DelegatingNamespace. -
Method Summary
Modifier and TypeMethodDescription@Nullable RelDataTypeFieldReturns a field of a given name, or null.@Nullable SqlNodeReturns the parse tree node that at is at the root of this namespace and includes all decorations.Returns a list of expressions which are monotonic in this namespace.getMonotonicity(String columnName) Returns whether and how a given column is sorted.@Nullable SqlNodegetNode()Returns the parse tree node at the root of this namespace.Returns the row type of this namespace, which comprises a list of names and types of the output columns.Returns the row type of this namespace, sans any system columns.@Nullable SqlValidatorTablegetTable()Returns the underlying table, or null if there is none.getType()Returns the type of this namespace.Returns the validator.booleanisWrapperFor(Class<?> clazz) Returns whether this namespace implements a given interface, or wraps a class which does.@Nullable SqlValidatorNamespacelookupChild(String name) Looks up a child namespace of a given name.voidvoidsetType(RelDataType type) Sets the type of this namespace.<T> TReturns this namespace, or a wrapped namespace, cast to a particular class.voidvalidate(RelDataType targetRowType) Validates this namespace.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.calcite.sql.validate.SqlValidatorNamespace
fieldExists, getFilterRequirement, resolve, supportsModality
-
Field Details
-
namespace
-
-
Constructor Details
-
DelegatingNamespace
Creates a DelegatingNamespace.- Parameters:
namespace- Underlying namespace, to delegate to
-
-
Method Details
-
getValidator
Description copied from interface:SqlValidatorNamespaceReturns the validator.- Specified by:
getValidatorin interfaceSqlValidatorNamespace- Returns:
- validator
-
getTable
Description copied from interface:SqlValidatorNamespaceReturns the underlying table, or null if there is none.- Specified by:
getTablein interfaceSqlValidatorNamespace
-
getRowType
Description copied from interface:SqlValidatorNamespaceReturns the row type of this namespace, which comprises a list of names and types of the output columns. If the scope's type has not yet been derived, derives it.- Specified by:
getRowTypein interfaceSqlValidatorNamespace- Returns:
- Row type of this namespace, never null, always a struct
-
setType
Description copied from interface:SqlValidatorNamespaceSets the type of this namespace.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.
- Specified by:
setTypein interfaceSqlValidatorNamespace
-
getRowTypeSansSystemColumns
Description copied from interface:SqlValidatorNamespaceReturns the row type of this namespace, sans any system columns.- Specified by:
getRowTypeSansSystemColumnsin interfaceSqlValidatorNamespace- Returns:
- Row type sans system columns
-
getType
Description copied from interface:SqlValidatorNamespaceReturns the type of this namespace.- Specified by:
getTypein interfaceSqlValidatorNamespace- Returns:
- Row type converted to struct
-
validate
Description copied from interface:SqlValidatorNamespaceValidates this namespace.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.- Specified by:
validatein interfaceSqlValidatorNamespace- Parameters:
targetRowType- Desired row type, must not be null, may be the data type 'unknown'.
-
getNode
Description copied from interface:SqlValidatorNamespaceReturns the parse tree node at the root of this namespace.- Specified by:
getNodein interfaceSqlValidatorNamespace- Returns:
- parse tree node; null for
TableNamespace
-
getEnclosingNode
Description copied from interface:SqlValidatorNamespaceReturns the parse tree node that at is at the root of this namespace and includes all decorations. If there are no decorations, returns the same asSqlValidatorNamespace.getNode().- Specified by:
getEnclosingNodein interfaceSqlValidatorNamespace
-
lookupChild
Description copied from interface:SqlValidatorNamespaceLooks up a child namespace of a given name.For example, in the query
select e.name from emps as e,eis anIdentifierNamespacewhich has a childnamewhich is aFieldNamespace.- Specified by:
lookupChildin interfaceSqlValidatorNamespace- Parameters:
name- Name of namespace- Returns:
- Namespace
-
field
Description copied from interface:SqlValidatorNamespaceReturns a field of a given name, or null.- Specified by:
fieldin interfaceSqlValidatorNamespace- Parameters:
name- Field name- Returns:
- Field, or null
-
getMonotonicExprs
Description copied from interface:SqlValidatorNamespaceReturns a list of expressions which are monotonic in this namespace. For example, if the namespace represents a relation ordered by a column called "TIMESTAMP", then the list would contain aSqlIdentifiercalled "TIMESTAMP".- Specified by:
getMonotonicExprsin interfaceSqlValidatorNamespace
-
getMonotonicity
Description copied from interface:SqlValidatorNamespaceReturns whether and how a given column is sorted.- Specified by:
getMonotonicityin interfaceSqlValidatorNamespace
-
makeNullable
public void makeNullable()- Specified by:
makeNullablein interfaceSqlValidatorNamespace
-
unwrap
Description copied from interface:SqlValidatorNamespaceReturns this namespace, or a wrapped namespace, cast to a particular class.- Specified by:
unwrapin interfaceSqlValidatorNamespace- Parameters:
clazz- Desired type- Returns:
- This namespace cast to desired type
-
isWrapperFor
Description copied from interface:SqlValidatorNamespaceReturns whether this namespace implements a given interface, or wraps a class which does.- Specified by:
isWrapperForin interfaceSqlValidatorNamespace- Parameters:
clazz- Interface- Returns:
- Whether namespace implements given interface
-