Package org.apache.calcite.schema.lookup
Class CompatibilityLookup<T>
java.lang.Object
org.apache.calcite.schema.lookup.IgnoreCaseLookup<T>
org.apache.calcite.schema.lookup.CompatibilityLookup<T>
- Type Parameters:
T
- Element type
- All Implemented Interfaces:
Lookup<T>
This class warps a
Function
and a Supplier
into a
Lookup
interface.
This class can be used to implement the methods Schema.tables()
and Schema.subSchemas()
of existing schemas.
Existing schema classes are implementing a pair of getTable()
and getTableNames()
methods. But these schemas should
also provide a tables()
method. This class can be used
to implement this method. See Schema.tables()
for
an example.
-
Constructor Details
-
CompatibilityLookup
Constructor to create aLookup
instance using a `Function` and a `Supplier`.- Parameters:
get
- a function to lookup tables or sub schemas by namegetNames
- a function to list all tables or sub schemas
-
-
Method Details
-
get
Description copied from class:IgnoreCaseLookup
Returns a named entity with a given name, or null if not found. -
getNames
Description copied from interface:Lookup
Returns the names of the entities in matching pattern. The search is always case sensitive. This is caused by the fact thatDatabaseMetaData.getTables(...)
doesn't support case insensitive lookups.
-