Package org.apache.calcite.schema.lookup
Interface Lookup<T>
- Type Parameters:
T- Element type
- All Known Implementing Classes:
CompatibilityLookup,IgnoreCaseLookup,LoadingCacheLookup,SnapshotLookup
public interface Lookup<T>
A case sensitive/insensitive lookup for tables, schemas, functions, types ...
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Lookup<T>Concat a list of lookups.static <T> Lookup<T>empty()Returns an empty lookup.@Nullable TReturns a named entity with a given name, or null if not found.static <T> @Nullable THelper method to callLookup.get(String)orLookup.getIgnoreCase(String)depending on the parameter caseSensitive.getIgnoreCase(String name) Returns a named entity with a given name ignoring the case, or null if not found.getNames(LikePattern pattern) Returns the names of the entities in matching pattern.default <S> Lookup<S>map(BiFunction<T, String, S> mapper) static <T> Lookup<T>Creates a new lookup object based on a NameMap.
-
Method Details
-
get
Returns a named entity with a given name, or null if not found.- Parameters:
name- Name- Returns:
- Entity with the specified name, or null when the entity is not found.
-
getIgnoreCase
Returns a named entity with a given name ignoring the case, or null if not found.- Parameters:
name- Name- Returns:
- Entity with the specified name (case insensitive), or null when the entity is not found.
-
getNames
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.- Returns:
- The names of all entities matching the pattern.
-
map
-
get
Helper method to callLookup.get(String)orLookup.getIgnoreCase(String)depending on the parameter caseSensitive.- Returns:
- Entity with the specified name, or null when the entity is not found.
-
empty
Returns an empty lookup. -
of
Creates a new lookup object based on a NameMap. -
concat
Concat a list of lookups.
-