Package org.apache.calcite.prepare
Interface Prepare.CatalogReader
- All Superinterfaces:
RelOptSchema
,SqlOperatorTable
,SqlValidatorCatalogReader
,Wrapper
- All Known Implementing Classes:
CalciteCatalogReader
,MockCatalogReader
,MockCatalogReaderDynamic
,MockCatalogReaderExtended
,MockCatalogReaderSimple
,MustFilterMockCatalogReader
- Enclosing class:
Prepare
public static interface Prepare.CatalogReader
extends RelOptSchema, SqlValidatorCatalogReader, SqlOperatorTable
Interface by which validator and planner can read table metadata.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable Prepare.PreparingTable
Finds a table or schema with the given name, possibly qualified.@Nullable Prepare.PreparingTable
getTableForMember
(List<String> names) Retrieves aRelOptTable
based upon a member access.withSchemaPath
(List<String> schemaPath) Returns a catalog reader the same as this one but with a possibly different schema path.Methods inherited from interface org.apache.calcite.plan.RelOptSchema
getTypeFactory, registerRules
Methods inherited from interface org.apache.calcite.sql.SqlOperatorTable
getOperatorList, lookupOperatorOverloads
Methods inherited from interface org.apache.calcite.sql.validate.SqlValidatorCatalogReader
createTypeFromProjection, field, getAllSchemaObjectNames, getConfig, getNamedType, getRootSchema, getSchemaPaths, isCaseSensitive, matches, nameMatcher
Methods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrap, unwrapOrThrow
-
Field Details
-
THREAD_LOCAL
-
-
Method Details
-
getTableForMember
Description copied from interface:RelOptSchema
Retrieves aRelOptTable
based upon a member access.For example, the Saffron expression
salesSchema.emps
would be resolved using a call tosalesSchema.getTableForMember(new String[]{"emps" })
.Note that name.length is only greater than 1 for queries originating from JDBC.
- Specified by:
getTableForMember
in interfaceRelOptSchema
- Parameters:
names
- Qualified name
-
withSchemaPath
Returns a catalog reader the same as this one but with a possibly different schema path. -
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
-