Package org.apache.druid.segment.join
Interface JoinMatcher
-
- All Known Implementing Classes:
IndexedTableJoinMatcher
,LookupJoinMatcher
public interface JoinMatcher
An interface returned byJoinable.makeJoinMatcher(org.apache.druid.segment.ColumnSelectorFactory, org.apache.druid.segment.join.JoinConditionAnalysis, boolean, boolean, org.apache.druid.java.util.common.io.Closer)
and used byHashJoinEngine
to implement a join. A typical usage would go something like:matcher.matchCondition(); while (matcher.hasMatch()) { // Do something with the match matcher.nextMatch(); }
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ColumnSelectorFactory
getColumnSelectorFactory()
Returns a factory for reading columns from theJoinable
that correspond to matched rows.boolean
hasMatch()
Returns whether the active matcher (matchCondition()
ormatchRemainder()
) 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
-
getColumnSelectorFactory
ColumnSelectorFactory getColumnSelectorFactory()
Returns a factory for reading columns from theJoinable
that correspond to matched rows.
-
matchCondition
void matchCondition()
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,hasMatch()
will return whether at least one row matched. After reading that row,nextMatch()
can be used to move on to the next row.
-
matchRemainder
void matchRemainder()
Matches every row that has not already been matched. Used for right joins. After calling this method,hasMatch()
will return whether at least one row matched. After reading that row,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
.
-
hasMatch
boolean hasMatch()
Returns whether the active matcher (matchCondition()
ormatchRemainder()
) has matched something.
-
nextMatch
void nextMatch()
Moves on to the next match. It is only valid to call this ifhasMatch()
is true.
-
matchingRemainder
boolean matchingRemainder()
Returns whether this matcher is currently matching the remainder (i.e. ifmatchRemainder()
was the most recent match method called).
-
reset
void reset()
Clears any active matches. Does not clear memory about what has been matched in the past.
-
-