Interface SqlValidatorCatalogReader
-
- All Superinterfaces:
Wrapper
- All Known Subinterfaces:
Prepare.CatalogReader
- All Known Implementing Classes:
CalciteCatalogReader
,DelegatingSqlValidatorCatalogReader
public interface SqlValidatorCatalogReader extends Wrapper
Supplies catalog information forSqlValidator
.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
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description RelDataType
createTypeFromProjection(RelDataType type, java.util.List<java.lang.String> columnNameList)
RelDataTypeField
field(RelDataType rowType, java.lang.String alias)
Deprecated.java.util.List<SqlMoniker>
getAllSchemaObjectNames(java.util.List<java.lang.String> names)
Given fully qualified schema name, returns schema object names as specified.CalciteConnectionConfig
getConfig()
Returns Config settingsRelDataType
getNamedType(SqlIdentifier typeName)
Finds a user-defined type with the given name, possibly qualified.CalciteSchema
getRootSchema()
Returns the root namespace for name resolution.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.boolean
isCaseSensitive()
Deprecated.boolean
matches(java.lang.String string, java.lang.String name)
Deprecated.SqlNameMatcher
nameMatcher()
Returns an implementation ofSqlNameMatcher
that matches the case-sensitivity policy.
-
-
-
Method Detail
-
getTable
SqlValidatorTable getTable(java.util.List<java.lang.String> names)
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
RelDataType getNamedType(SqlIdentifier typeName)
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
java.util.List<SqlMoniker> getAllSchemaObjectNames(java.util.List<java.lang.String> names)
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
java.util.List<java.util.List<java.lang.String>> getSchemaPaths()
Returns the paths of all schemas to look in for tables.- Returns:
- paths of current schema and root schema
-
field
@Deprecated RelDataTypeField field(RelDataType rowType, java.lang.String alias)
Deprecated.
-
nameMatcher
SqlNameMatcher nameMatcher()
Returns an implementation ofSqlNameMatcher
that matches the case-sensitivity policy.
-
matches
@Deprecated boolean matches(java.lang.String string, java.lang.String name)
Deprecated.
-
createTypeFromProjection
RelDataType createTypeFromProjection(RelDataType type, java.util.List<java.lang.String> columnNameList)
-
isCaseSensitive
@Deprecated boolean isCaseSensitive()
Deprecated.
-
getRootSchema
CalciteSchema getRootSchema()
Returns the root namespace for name resolution.
-
getConfig
CalciteConnectionConfig getConfig()
Returns Config settings
-
-