Package org.apache.calcite.prepare
Interface Prepare.CatalogReader
-
- All Superinterfaces:
RelOptSchema
,SqlOperatorTable
,SqlValidatorCatalogReader
,Wrapper
- All Known Implementing Classes:
CalciteCatalogReader
- Enclosing class:
- Prepare
public static interface Prepare.CatalogReader extends RelOptSchema, SqlValidatorCatalogReader, SqlOperatorTable
Interface by which validator and planner can read table metadata.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.ThreadLocal<Prepare.CatalogReader>
THREAD_LOCAL
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Prepare.PreparingTable
getTable(java.util.List<java.lang.String> names)
Finds a table or schema with the given name, possibly qualified.Prepare.PreparingTable
getTableForMember(java.util.List<java.lang.String> names)
Retrieves aRelOptTable
based upon a member access.Prepare.CatalogReader
withSchemaPath(java.util.List<java.lang.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
-
-
-
-
Field Detail
-
THREAD_LOCAL
static final java.lang.ThreadLocal<Prepare.CatalogReader> THREAD_LOCAL
-
-
Method Detail
-
getTableForMember
Prepare.PreparingTable getTableForMember(java.util.List<java.lang.String> names)
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
Prepare.CatalogReader withSchemaPath(java.util.List<java.lang.String> schemaPath)
Returns a catalog reader the same as this one but with a possibly different schema path.
-
getTable
Prepare.PreparingTable 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
-
-