public interface SqlValidatorCatalogReader extends Wrapper
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.
| Modifier and Type | Method and Description |
|---|---|
RelDataType |
createTypeFromProjection(RelDataType type,
List<String> columnNameList) |
@Nullable RelDataTypeField |
field(RelDataType rowType,
String alias)
Deprecated.
|
List<SqlMoniker> |
getAllSchemaObjectNames(List<String> names)
Given fully qualified schema name, returns schema object names as
specified.
|
CalciteConnectionConfig |
getConfig()
Returns Config settings.
|
@Nullable RelDataType |
getNamedType(SqlIdentifier typeName)
Finds a user-defined type with the given name, possibly qualified.
|
CalciteSchema |
getRootSchema()
Returns the root namespace for name resolution.
|
List<List<String>> |
getSchemaPaths()
Returns the paths of all schemas to look in for tables.
|
@Nullable SqlValidatorTable |
getTable(List<String> names)
Finds a table or schema with the given name, possibly qualified.
|
boolean |
isCaseSensitive()
Deprecated.
|
boolean |
matches(String string,
String name)
Deprecated.
|
SqlNameMatcher |
nameMatcher()
Returns an implementation of
SqlNameMatcher
that matches the case-sensitivity policy. |
maybeUnwrap, unwrap, unwrapOrThrow@Nullable SqlValidatorTable getTable(List<String> names)
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).
names - Name of table, may be qualified or fully-qualified@Nullable RelDataType getNamedType(SqlIdentifier typeName)
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.
typeName - Name of typeList<SqlMoniker> getAllSchemaObjectNames(List<String> names)
names - the array contains fully qualified schema name or empty
list for root schemaList<List<String>> getSchemaPaths()
@Deprecated @Nullable RelDataTypeField field(RelDataType rowType, String alias)
nameMatcher().SqlNameMatcher.field(RelDataType, String)SqlNameMatcher nameMatcher()
SqlNameMatcher
that matches the case-sensitivity policy.@Deprecated boolean matches(String string, String name)
nameMatcher().SqlNameMatcher.matches(String, String)RelDataType createTypeFromProjection(RelDataType type, List<String> columnNameList)
@Deprecated boolean isCaseSensitive()
nameMatcher().SqlNameMatcher.isCaseSensitive()CalciteSchema getRootSchema()
CalciteConnectionConfig getConfig()
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.