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 java.lang.Object implements SqlValidatorCatalogReader
Implementation ofSqlValidatorCatalogReader
that passes all calls to a parent catalog reader.
-
-
Field Summary
Fields Modifier and Type Field Description protected SqlValidatorCatalogReader
catalogReader
-
Constructor Summary
Constructors Constructor Description DelegatingSqlValidatorCatalogReader(SqlValidatorCatalogReader catalogReader)
Creates a DelegatingSqlValidatorCatalogReader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<SqlMoniker>
getAllSchemaObjectNames(java.util.List<java.lang.String> names)
Given fully qualified schema name, returns schema object names as specified.RelDataType
getNamedType(SqlIdentifier typeName)
Finds a user-defined type with the given name, possibly qualified.java.util.List<java.util.List<java.lang.String>>
getSchemaPaths()
Returns the paths of all schemas to look in for tables.SqlValidatorTable
getTable(java.util.List<java.lang.String> names)
Finds a table or schema with the given name, possibly qualified.<C> C
unwrap(java.lang.Class<C> aClass)
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
-
-
-
-
Field Detail
-
catalogReader
protected final SqlValidatorCatalogReader catalogReader
-
-
Constructor Detail
-
DelegatingSqlValidatorCatalogReader
public DelegatingSqlValidatorCatalogReader(SqlValidatorCatalogReader catalogReader)
Creates a DelegatingSqlValidatorCatalogReader.- Parameters:
catalogReader
- Parent catalog reader
-
-
Method Detail
-
getTable
public SqlValidatorTable getTable(java.util.List<java.lang.String> names)
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
public RelDataType getNamedType(SqlIdentifier typeName)
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
public java.util.List<SqlMoniker> getAllSchemaObjectNames(java.util.List<java.lang.String> names)
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
public java.util.List<java.util.List<java.lang.String>> 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
-
-