JoinMatchContext#
- public class JoinMatchContext implements AutoCloseable#
The matches found by probing a left table against a
HashJoin, kept so the join results can be retrieved in partitions without probing again.Obtained from a Table factory such as
Table.innerJoinMatchContext(HashJoin), used to read match counts and output size, and used to retrieve a range of the left table withpartitionGatherMaps(int, int).The context must be closed, and the HashJoin it was created from must stay open for its lifetime. The context keeps its own reference to the left table, so the caller may close that table at any time.
This class is not thread safe. A context should be created, used and closed on one thread.
Method Summary
Concatenate the partition results of a FULL join and append the unmatched right rows.
The join kind that created this context.
The per-row match counts as an INT32 column.
The number of row pairs a full retrieval of the left table would produce.
Gather maps for a contiguous range of left rows.
Methods
- public long getOutputSize()#
The number of row pairs a full retrieval of the left table would produce.
- public ColumnVector getMatchCounts()#
The per-row match counts as an INT32 column.
The caller owns the returned column. The column is copied asynchronously on the calling thread’s stream.
- public GatherMap[] partitionGatherMaps(int leftStart, int leftEnd)#
Gather maps for a contiguous range of left rows.
For FULL joins the complement of unmatched right rows is not included. Call
finalizePartitionedFullJoin(GatherMap[]...)once all partitions have been retrieved.- Parameters:
leftStart – inclusive start row in the left table
leftEnd – exclusive end row in the left table
- Returns:
left and right gather maps for this partition
- public GatherMap[] finalizePartitionedFullJoin(
- GatherMap[]... partitions
Concatenate the partition results of a FULL join and append the unmatched right rows.
The row counts come from the left table and the HashJoin this context was created from. The input gather maps are not closed.
The partitions are not checked against this context. They must be the results of
partitionGatherMaps(int, int)calls on this context that together cover each left row exactly once, otherwise the result is incorrect.- Parameters:
partitions – the left and right gather map pair of each partition
- Throws:
IllegalStateException– if this is not a FULL join contextIllegalArgumentException– if a partition is not a pair of equal length gather maps
- Returns:
the full join left and right gather maps
- public void close()#