Interface SqlValidatorCatalogReader
- All Superinterfaces:
Wrapper
- All Known Subinterfaces:
Prepare.CatalogReader
- All Known Implementing Classes:
CalciteCatalogReader
,DelegatingSqlValidatorCatalogReader
,MockCatalogReader
,MockCatalogReaderDynamic
,MockCatalogReaderExtended
,MockCatalogReaderSimple
,MustFilterMockCatalogReader
SqlValidator
.
This interface only provides a thin API to the underlying repository, and this is intentional. By only presenting the repository information of interest to the validator, we reduce the dependency on exact mechanism to implement the repository. It is also possible to construct mock implementations of this interface for testing purposes.
-
Method Summary
Modifier and TypeMethodDescriptioncreateTypeFromProjection
(RelDataType type, List<String> columnNameList) @Nullable RelDataTypeField
field
(RelDataType rowType, String alias) Deprecated.getAllSchemaObjectNames
(List<String> names) Given fully qualified schema name, returns schema object names as specified.Returns Config settings.@Nullable RelDataType
getNamedType
(SqlIdentifier typeName) Finds a user-defined type with the given name, possibly qualified.Returns the root namespace for name resolution.Returns the paths of all schemas to look in for tables.@Nullable SqlValidatorTable
Finds a table or schema with the given name, possibly qualified.boolean
Deprecated.boolean
Deprecated.Returns an implementation ofSqlNameMatcher
that matches the case-sensitivity policy.Methods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrap, unwrapOrThrow
-
Method Details
-
getTable
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)
.- Parameters:
names
- Name of table, may be qualified or fully-qualified- Returns:
- Table with the given name, or null
-
getNamedType
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.
- Parameters:
typeName
- Name of type- Returns:
- named type, or null if not found
-
getAllSchemaObjectNames
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.- 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
Returns the paths of all schemas to look in for tables.- Returns:
- paths of current schema and root schema
-
field
Deprecated. -
nameMatcher
SqlNameMatcher nameMatcher()Returns an implementation ofSqlNameMatcher
that matches the case-sensitivity policy. -
matches
Deprecated. -
createTypeFromProjection
-
isCaseSensitive
Deprecated. -
getRootSchema
CalciteSchema getRootSchema()Returns the root namespace for name resolution. -
getConfig
CalciteConnectionConfig getConfig()Returns Config settings.
-
nameMatcher()
.SqlNameMatcher.field(RelDataType, String)