Interface Metadata

All Known Subinterfaces:
BuiltInMetadata.AllPredicates, BuiltInMetadata.Collation, BuiltInMetadata.ColumnOrigin, BuiltInMetadata.ColumnUniqueness, BuiltInMetadata.CumulativeCost, BuiltInMetadata.DistinctRowCount, BuiltInMetadata.Distribution, BuiltInMetadata.ExplainVisibility, BuiltInMetadata.ExpressionLineage, BuiltInMetadata.LowerBoundCost, BuiltInMetadata.MaxRowCount, BuiltInMetadata.Measure, BuiltInMetadata.Memory, BuiltInMetadata.MinRowCount, BuiltInMetadata.NodeTypes, BuiltInMetadata.NonCumulativeCost, BuiltInMetadata.Parallelism, BuiltInMetadata.PercentageOriginalRows, BuiltInMetadata.PopulationSize, BuiltInMetadata.Predicates, BuiltInMetadata.RowCount, BuiltInMetadata.Selectivity, BuiltInMetadata.Size, BuiltInMetadata.TableReferences, BuiltInMetadata.UniqueKeys

public interface Metadata
Metadata about a relational expression.

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();
 
  • Method Summary

    Modifier and Type
    Method
    Description
    rel()
    Returns the relational expression that this metadata is about.
  • Method Details

    • rel

      RelNode rel()
      Returns the relational expression that this metadata is about.