Class LookupJoinMatcher
- java.lang.Object
-
- org.apache.druid.segment.join.lookup.LookupJoinMatcher
-
- All Implemented Interfaces:
JoinMatcher
public class LookupJoinMatcher extends Object implements JoinMatcher
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LookupJoinMatcher
create(LookupExtractor extractor, ColumnSelectorFactory leftSelectorFactory, JoinConditionAnalysis condition, boolean remainderNeeded)
ColumnSelectorFactory
getColumnSelectorFactory()
Returns a factory for reading columns from theJoinable
that correspond to matched rows.boolean
hasMatch()
Returns whether the active matcher (JoinMatcher.matchCondition()
orJoinMatcher.matchRemainder()
) has matched something.void
matchCondition()
boolean
matchingRemainder()
Returns whether this matcher is currently matching the remainder (i.e.void
matchRemainder()
Matches every row that has not already been matched.void
nextMatch()
Moves on to the next match.void
reset()
Clears any active matches.
-
-
-
Method Detail
-
create
public static LookupJoinMatcher create(LookupExtractor extractor, ColumnSelectorFactory leftSelectorFactory, JoinConditionAnalysis condition, boolean remainderNeeded)
-
getColumnSelectorFactory
public ColumnSelectorFactory getColumnSelectorFactory()
Description copied from interface:JoinMatcher
Returns a factory for reading columns from theJoinable
that correspond to matched rows.- Specified by:
getColumnSelectorFactory
in interfaceJoinMatcher
-
matchCondition
public void matchCondition()
Description copied from interface:JoinMatcher
Matches against theColumnSelectorFactory
andJoinConditionAnalysis
supplied toJoinable.makeJoinMatcher(org.apache.druid.segment.ColumnSelectorFactory, org.apache.druid.segment.join.JoinConditionAnalysis, boolean, boolean, org.apache.druid.java.util.common.io.Closer)
. After calling this method,JoinMatcher.hasMatch()
will return whether at least one row matched. After reading that row,JoinMatcher.nextMatch()
can be used to move on to the next row.- Specified by:
matchCondition
in interfaceJoinMatcher
-
matchRemainder
public void matchRemainder()
Description copied from interface:JoinMatcher
Matches every row that has not already been matched. Used for right joins. After calling this method,JoinMatcher.hasMatch()
will return whether at least one row matched. After reading that row,JoinMatcher.nextMatch()
can be used to move on to the next row. Will only work correctly ifJoinable.makeJoinMatcher(org.apache.druid.segment.ColumnSelectorFactory, org.apache.druid.segment.join.JoinConditionAnalysis, boolean, boolean, org.apache.druid.java.util.common.io.Closer)
was called withremainderNeeded == true
.- Specified by:
matchRemainder
in interfaceJoinMatcher
-
hasMatch
public boolean hasMatch()
Description copied from interface:JoinMatcher
Returns whether the active matcher (JoinMatcher.matchCondition()
orJoinMatcher.matchRemainder()
) has matched something.- Specified by:
hasMatch
in interfaceJoinMatcher
-
matchingRemainder
public boolean matchingRemainder()
Description copied from interface:JoinMatcher
Returns whether this matcher is currently matching the remainder (i.e. ifJoinMatcher.matchRemainder()
was the most recent match method called).- Specified by:
matchingRemainder
in interfaceJoinMatcher
-
nextMatch
public void nextMatch()
Description copied from interface:JoinMatcher
Moves on to the next match. It is only valid to call this ifJoinMatcher.hasMatch()
is true.- Specified by:
nextMatch
in interfaceJoinMatcher
-
reset
public void reset()
Description copied from interface:JoinMatcher
Clears any active matches. Does not clear memory about what has been matched in the past.- Specified by:
reset
in interfaceJoinMatcher
-
-