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 with partitionGatherMaps(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

close()

finalizePartitionedFullJoin(GatherMap[]... partitions)

Concatenate the partition results of a FULL join and append the unmatched right rows.

getJoinKind()

The join kind that created this context.

getMatchCounts()

The per-row match counts as an INT32 column.

getOutputSize()

The number of row pairs a full retrieval of the left table would produce.

partitionGatherMaps(int leftStart, int leftEnd)

Gather maps for a contiguous range of left rows.

Methods

public JoinKind getJoinKind()#

The join kind that created this context.

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:
Returns:

the full join left and right gather maps

public void close()#