Class PartialMatch
- java.lang.Object
-
- com.apple.foundationdb.record.query.plan.temp.PartialMatch
-
- All Implemented Interfaces:
Bindable
public class PartialMatch extends Object implements Bindable
Case class to represent a partial match. A partial match is stored in a multi map inGroupExpressionRef
s that are part of a query graph. A partial match is never stored in aGroupExpressionRef
of a match candidate. A partial match establishes the a relation ships between a referenceref1
in a query graph and a referenceref2
in a match candidate. It should be interpreted as there is a partial match betweenref1
andref2
ifref1
is result-equivalent toref2'
under the bindings in the alias map returned by (getBoundAliasMap()
) whereref2'
is obtained by is applying compensation toref2
. If there is no compensation this simplifies to: there is a partial match betweenref1
andref2
ifref1
is result-equivalent toref2
under the bindings in the alias map returned by (getBoundAliasMap()
). It is the task of a matching algorithm (seeCascadesPlanner
) to establishPartialMatch
es between query graph and match candidate graphs. Once there is a partial match for the top-most reference in the match candidate, we can replace the reference on the query graph side with a scan over the match candidate's materialized version (e.g. an index) and subsequent compensation.
-
-
Constructor Summary
Constructors Constructor Description PartialMatch(AliasMap boundAliasMap, MatchCandidate matchCandidate, ExpressionRef<? extends RelationalExpression> queryRef, RelationalExpression queryExpression, ExpressionRef<? extends RelationalExpression> candidateRef, MatchInfo matchInfo)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stream<PlannerBindings>
bindTo(PlannerBindings outerBindings, ExpressionMatcher<? extends Bindable> matcher)
Attempt to match the matcher to this bindable object.Compensation
compensate(Map<CorrelationIdentifier,ComparisonRange> boundParameterPrefixMap)
AliasMap
getBoundAliasMap()
Map<CorrelationIdentifier,ComparisonRange>
getBoundParameterPrefixMap()
ExpressionRef<? extends RelationalExpression>
getCandidateRef()
MatchCandidate
getMatchCandidate()
MatchInfo
getMatchInfo()
int
getNumBoundParameterPrefix()
RelationalExpression
getQueryExpression()
ExpressionRef<? extends RelationalExpression>
getQueryRef()
static Collection<MatchInfo>
matchesFromMap(IdentityBiMap<Quantifier,PartialMatch> partialMatchMap)
-
-
-
Constructor Detail
-
PartialMatch
public PartialMatch(@Nonnull AliasMap boundAliasMap, @Nonnull MatchCandidate matchCandidate, @Nonnull ExpressionRef<? extends RelationalExpression> queryRef, @Nonnull RelationalExpression queryExpression, @Nonnull ExpressionRef<? extends RelationalExpression> candidateRef, @Nonnull MatchInfo matchInfo)
-
-
Method Detail
-
getMatchCandidate
@Nonnull public MatchCandidate getMatchCandidate()
-
getQueryRef
@Nonnull public ExpressionRef<? extends RelationalExpression> getQueryRef()
-
getQueryExpression
@Nonnull public RelationalExpression getQueryExpression()
-
getCandidateRef
@Nonnull public ExpressionRef<? extends RelationalExpression> getCandidateRef()
-
getNumBoundParameterPrefix
public int getNumBoundParameterPrefix()
-
getBoundParameterPrefixMap
public Map<CorrelationIdentifier,ComparisonRange> getBoundParameterPrefixMap()
-
bindTo
@Nonnull public Stream<PlannerBindings> bindTo(@Nonnull PlannerBindings outerBindings, @Nonnull ExpressionMatcher<? extends Bindable> matcher)
Description copied from interface:Bindable
Attempt to match the matcher to this bindable object.
-
compensate
@Nonnull public Compensation compensate(@Nonnull Map<CorrelationIdentifier,ComparisonRange> boundParameterPrefixMap)
-
matchesFromMap
@Nonnull public static Collection<MatchInfo> matchesFromMap(@Nonnull IdentityBiMap<Quantifier,PartialMatch> partialMatchMap)
-
-