Package org.apache.calcite.adapter.jdbc
Class JdbcCatalogSchema
java.lang.Object
org.apache.calcite.adapter.jdbc.JdbcBaseSchema
org.apache.calcite.adapter.jdbc.JdbcCatalogSchema
Schema based upon a JDBC catalog (database).
This schema does not directly contain tables, but contains a sub-schema
for each schema in the catalog in the back-end. Each of those sub-schemas is
an instance of JdbcSchema
.
This schema is lazy: it does not compute the list of schema names until
the first call to subSchemas()
and Lookup.get(String)
. Then it creates a
JdbcSchema
for this schema name. Each JdbcSchema will populate its
tables on demand.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.schema.Schema
Schema.TableType
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJdbcCatalogSchema
(DataSource dataSource, SqlDialect dialect, JdbcConvention convention, String catalog) Creates a JdbcCatalogSchema. -
Method Summary
Modifier and TypeMethodDescriptionstatic JdbcCatalogSchema
create
(@Nullable SchemaPlus parentSchema, String name, DataSource dataSource, String catalog) static JdbcCatalogSchema
create
(@Nullable SchemaPlus parentSchema, String name, DataSource dataSource, SqlDialectFactory dialectFactory, String catalog) Returns the data source.@Nullable String
Returns the name of the default sub-schema.Returns a lookup object to find sub schemas.tables()
Returns a lookup object to find tables.<T> @Nullable T
Finds an instance of an interface implemented by this object, or returns null if this object does not support that interface.Methods inherited from class org.apache.calcite.adapter.jdbc.JdbcBaseSchema
getExpression, getFunctionNames, getFunctions, getSubSchema, getSubSchemaNames, getTable, getTableNames, getType, getTypeNames, isMutable, snapshot
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrapOrThrow
-
Field Details
-
dialect
-
-
Constructor Details
-
JdbcCatalogSchema
public JdbcCatalogSchema(DataSource dataSource, SqlDialect dialect, JdbcConvention convention, String catalog) Creates a JdbcCatalogSchema.
-
-
Method Details
-
create
public static JdbcCatalogSchema create(@Nullable SchemaPlus parentSchema, String name, DataSource dataSource, String catalog) -
create
public static JdbcCatalogSchema create(@Nullable SchemaPlus parentSchema, String name, DataSource dataSource, SqlDialectFactory dialectFactory, String catalog) -
tables
Description copied from interface:Schema
Returns a lookup object to find tables.- Specified by:
tables
in interfaceSchema
- Specified by:
tables
in classJdbcBaseSchema
- Returns:
- Lookup
-
subSchemas
Description copied from interface:Schema
Returns a lookup object to find sub schemas.- Specified by:
subSchemas
in interfaceSchema
- Specified by:
subSchemas
in classJdbcBaseSchema
- Returns:
- Lookup
-
getDefaultSubSchemaName
Returns the name of the default sub-schema. -
getDataSource
Returns the data source. -
unwrap
Description copied from interface:Wrapper
Finds an instance of an interface implemented by this object, or returns null if this object does not support that interface.
-