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(java.lang.Class<? extends RelNode> relClass,
java.lang.Class<? extends M> metadataClass)
Retrieves metadata of a particular type and for a particular sub-class
of relational expression.
|
<M extends Metadata> |
handlers(MetadataDef<M> def) |
<M extends Metadata> UnboundMetadata<M> apply(java.lang.Class<? extends RelNode> relClass, java.lang.Class<? extends M> metadataClass)
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<M extends Metadata> com.google.common.collect.Multimap<java.lang.reflect.Method,MetadataHandler<M>> handlers(MetadataDef<M> def)
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.