Package org.apache.calcite.rel.metadata
Class RelMdAllPredicates
- java.lang.Object
-
- org.apache.calcite.rel.metadata.RelMdAllPredicates
-
- All Implemented Interfaces:
MetadataHandler<BuiltInMetadata.AllPredicates>
public class RelMdAllPredicates extends java.lang.Object implements MetadataHandler<BuiltInMetadata.AllPredicates>
Utility to extract Predicates that are present in the (sub)plan starting at this node.This should be used to infer whether same filters are applied on a given plan by materialized view rewriting rules.
The output predicates might contain references to columns produced by TableScan operators (
RexTableInputRef
). In turn, each TableScan operator is identified uniquely by its qualified name and an identifier.If the provider cannot infer the lineage for any of the expressions contain in any of the predicates, it will return null. Observe that this is different from the empty list of predicates, which means that there are not predicates in the (sub)plan.
-
-
Field Summary
Fields Modifier and Type Field Description static RelMetadataProvider
SOURCE
-
Constructor Summary
Constructors Constructor Description RelMdAllPredicates()
-
Method Summary
-
-
-
Field Detail
-
SOURCE
public static final RelMetadataProvider SOURCE
-
-
Method Detail
-
getDef
public MetadataDef<BuiltInMetadata.AllPredicates> getDef()
- Specified by:
getDef
in interfaceMetadataHandler<BuiltInMetadata.AllPredicates>
-
getAllPredicates
public RelOptPredicateList getAllPredicates(RelNode rel, RelMetadataQuery mq)
Catch-all implementation forBuiltInMetadata.AllPredicates.getAllPredicates()
, invoked using reflection.
-
getAllPredicates
public RelOptPredicateList getAllPredicates(HepRelVertex rel, RelMetadataQuery mq)
-
getAllPredicates
public RelOptPredicateList getAllPredicates(RelSubset rel, RelMetadataQuery mq)
-
getAllPredicates
public RelOptPredicateList getAllPredicates(TableScan table, RelMetadataQuery mq)
Extract predicates for a table scan.
-
getAllPredicates
public RelOptPredicateList getAllPredicates(Project project, RelMetadataQuery mq)
Extract predicates for a project.
-
getAllPredicates
public RelOptPredicateList getAllPredicates(Filter filter, RelMetadataQuery mq)
Add the Filter condition to the list obtained from the input.
-
getAllPredicates
public RelOptPredicateList getAllPredicates(Join join, RelMetadataQuery mq)
Add the Join condition to the list obtained from the input.
-
getAllPredicates
public RelOptPredicateList getAllPredicates(Aggregate agg, RelMetadataQuery mq)
Extract predicates for an Aggregate.
-
getAllPredicates
public RelOptPredicateList getAllPredicates(Union union, RelMetadataQuery mq)
Extract predicates for a Union.
-
getAllPredicates
public RelOptPredicateList getAllPredicates(Sort sort, RelMetadataQuery mq)
Extract predicates for a Sort.
-
getAllPredicates
public RelOptPredicateList getAllPredicates(Exchange exchange, RelMetadataQuery mq)
Extract predicates for an Exchange.
-
-