public interface Metadata
For particular types of metadata, a sub-class defines one of more methods
to query that metadata. Then a RelMetadataProvider can offer those
kinds of metadata for particular sub-classes of RelNode.
User code (typically in a planner rule or an implementation of
RelNode.computeSelfCost(org.apache.calcite.plan.RelOptPlanner, RelMetadataQuery))
acquires a Metadata instance by calling RelNode.metadata(java.lang.Class<M>, org.apache.calcite.rel.metadata.RelMetadataQuery).
A Metadata instance already knows which particular RelNode
it is describing, so the methods do not pass in the RelNode. In fact,
quite a few metadata methods have no extra parameters. For instance, you can
get the row-count as follows:
RelNode rel; double rowCount = rel.metadata(RowCount.class).rowCount();
| Modifier and Type | Method and Description |
|---|---|
RelNode |
rel()
Returns the relational expression that this metadata is about.
|
RelNode rel()
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.