public interface RelMetadataProvider
RelMetadataQuery.
For background and motivation, see wiki.
If your provider is not a singleton, we recommend that you implement
Object.equals(Object) and Object.hashCode() methods. This
makes the cache of JaninoRelMetadataProvider more effective.
| Modifier and Type | Method and Description |
|---|---|
<M extends Metadata> |
apply(Class<? extends RelNode> relClass,
Class<? extends M> metadataClass)
Deprecated.
Use
RelMetadataQuery. |
List<MetadataHandler<?>> |
handlers(Class<? extends MetadataHandler<?>> handlerClass)
Retrieves a list of
MetadataHandler for implements a particular
MetadataHandler.class. |
<M extends Metadata> |
handlers(MetadataDef<M> def)
Deprecated.
|
@Deprecated <M extends Metadata> @Nullable UnboundMetadata<M> apply(Class<? extends RelNode> relClass, Class<? extends M> metadataClass)
RelMetadataQuery.The object returned is a function. It can be applied to a relational expression of the given type to create a metadata object.
For example, you might call
RelMetadataProvider provider; LogicalFilter filter; RexNode predicate; Function<RelNode, Metadata> function = provider.apply(LogicalFilter.class, Selectivity.class}; Selectivity selectivity = function.apply(filter); Double d = selectivity.selectivity(predicate);
relClass - Type of relational expressionmetadataClass - Type of metadata@Deprecated <M extends Metadata> com.google.common.collect.Multimap<Method,MetadataHandler<M>> handlers(MetadataDef<M> def)
List<MetadataHandler<?>> handlers(Class<? extends MetadataHandler<?>> handlerClass)
MetadataHandler for implements a particular
MetadataHandler.class. The resolution order is specificity of the relNode class,
with preference given to handlers that occur earlier in the list.
For instance, given a return list of {A, B, C} where A implements RelNode and Scan,
B implements Scan, and C implements LogicalScan and Filter.
Scan dispatches to a.method(Scan)
LogicalFilter dispatches to c.method(Filter).
LogicalScan dispatches to c.method(LogicalScan).
Aggregate dispatches to a.method(RelNode).
The behavior is undefined if the class hierarchy for dispatching is not a tree.Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.