Package org.apache.calcite.sql.validate
Class DelegatingSqlValidatorCatalogReader
java.lang.Object
org.apache.calcite.sql.validate.DelegatingSqlValidatorCatalogReader
- All Implemented Interfaces:
Wrapper
,SqlValidatorCatalogReader
public abstract class DelegatingSqlValidatorCatalogReader
extends Object
implements SqlValidatorCatalogReader
Implementation of
SqlValidatorCatalogReader
that passes
all calls to a parent catalog reader.-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
DelegatingSqlValidatorCatalogReader
(SqlValidatorCatalogReader catalogReader) Creates a DelegatingSqlValidatorCatalogReader. -
Method Summary
Modifier and TypeMethodDescriptiongetAllSchemaObjectNames
(List<String> names) Given fully qualified schema name, returns schema object names as specified.@Nullable RelDataType
getNamedType
(SqlIdentifier typeName) Finds a user-defined type with the given name, possibly qualified.Returns the paths of all schemas to look in for tables.@Nullable SqlValidatorTable
Finds a table or schema with the given name, possibly qualified.<C> @Nullable C
Finds an instance of an interface implemented by this object, or returns null if this object does not support that interface.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.calcite.sql.validate.SqlValidatorCatalogReader
createTypeFromProjection, field, getConfig, getRootSchema, isCaseSensitive, matches, nameMatcher
Methods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrapOrThrow
-
Field Details
-
catalogReader
-
-
Constructor Details
-
DelegatingSqlValidatorCatalogReader
Creates a DelegatingSqlValidatorCatalogReader.- Parameters:
catalogReader
- Parent catalog reader
-
-
Method Details
-
getTable
Description copied from interface:SqlValidatorCatalogReader
Finds a table or schema with the given name, possibly qualified.Uses the case-sensitivity policy of the catalog reader.
If not found, returns null. If you want a more descriptive error message or to override the case-sensitivity of the match, use
SqlValidatorScope.resolveTable(java.util.List<java.lang.String>, org.apache.calcite.sql.validate.SqlNameMatcher, org.apache.calcite.sql.validate.SqlValidatorScope.Path, org.apache.calcite.sql.validate.SqlValidatorScope.Resolved)
.- Specified by:
getTable
in interfaceSqlValidatorCatalogReader
- Parameters:
names
- Name of table, may be qualified or fully-qualified- Returns:
- Table with the given name, or null
-
getNamedType
Description copied from interface:SqlValidatorCatalogReader
Finds a user-defined type with the given name, possibly qualified.NOTE jvs 12-Feb-2005: the reason this method is defined here instead of on RelDataTypeFactory is that it has to take into account context-dependent information such as SQL schema path, whereas a type factory is context-independent.
- Specified by:
getNamedType
in interfaceSqlValidatorCatalogReader
- Parameters:
typeName
- Name of type- Returns:
- named type, or null if not found
-
getAllSchemaObjectNames
Description copied from interface:SqlValidatorCatalogReader
Given fully qualified schema name, returns schema object names as specified. They can be schema, table, function, view. When names array is empty, the contents of root schema should be returned.- Specified by:
getAllSchemaObjectNames
in interfaceSqlValidatorCatalogReader
- Parameters:
names
- the array contains fully qualified schema name or empty list for root schema- Returns:
- the list of all object (schema, table, function, view) names under the above criteria
-
getSchemaPaths
Description copied from interface:SqlValidatorCatalogReader
Returns the paths of all schemas to look in for tables.- Specified by:
getSchemaPaths
in interfaceSqlValidatorCatalogReader
- Returns:
- paths of current schema and root schema
-
unwrap
Description copied from interface:Wrapper
Finds an instance of an interface implemented by this object, or returns null if this object does not support that interface.
-