Class HashJoinBatch
java.lang.Object
org.apache.drill.exec.record.AbstractRecordBatch<T>
org.apache.drill.exec.record.AbstractBinaryRecordBatch<T>
org.apache.drill.exec.physical.impl.join.AbstractHashBinaryRecordBatch<HashJoinPOP>
org.apache.drill.exec.physical.impl.join.HashJoinBatch
- All Implemented Interfaces:
AutoCloseable
,Iterable<VectorWrapper<?>>
,RowKeyJoin
,CloseableRecordBatch
,RecordBatch
,VectorAccessible
Implements the runtime execution for the Hash-Join operator supporting INNER,
LEFT OUTER, RIGHT OUTER, and FULL OUTER joins
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.drill.exec.physical.impl.join.AbstractHashBinaryRecordBatch
AbstractHashBinaryRecordBatch.Metric, AbstractHashBinaryRecordBatch.SpilledPartition, AbstractHashBinaryRecordBatch.Updater
Nested classes/interfaces inherited from class org.apache.drill.exec.record.AbstractRecordBatch
AbstractRecordBatch.BatchState
Nested classes/interfaces inherited from interface org.apache.drill.exec.record.RecordBatch
RecordBatch.IterOutcome
Nested classes/interfaces inherited from interface org.apache.drill.exec.physical.impl.join.RowKeyJoin
RowKeyJoin.RowKeyJoinState
-
Field Summary
Fields inherited from class org.apache.drill.exec.physical.impl.join.AbstractHashBinaryRecordBatch
allocator, baseHashTable, bloomFilter2buildId, bloomFilterDef2buildId, bloomFilters, bloomFiltersGenerated, buildBatch, buildComplete, buildJoinColumns, buildSchema, buildSideIsEmpty, canSpill, enableRuntimeFilter, firstOutputBatch, hash64, isRowKeyJoin, joinIsLeftOrFull, joinIsRightOrFull, logger, maxBatchesInMemory, numPartitions, originalPartition, outputRecords, partitions, prefetchedBuild, prefetchedProbe, probe, probeBatch, probeFields, probeSchema, probeSideIsEmpty, RECORDS_PER_BATCH, rightExpr, rightHVColPosition, rkJoinState, runtimeFilterDef, runtimeFilterReporter, semiJoin, skipHashTableBuild, spilledInners, spilledState, spillSet, wasKilled
Fields inherited from class org.apache.drill.exec.record.AbstractBinaryRecordBatch
batchMemoryManager, left, LEFT_INDEX, leftUpstream, numInputs, right, RIGHT_INDEX, rightUpstream
Fields inherited from class org.apache.drill.exec.record.AbstractRecordBatch
batchStatsContext, container, context, oContext, state, stats, unionTypeEnabled
Fields inherited from interface org.apache.drill.exec.record.RecordBatch
MAX_BATCH_ROW_COUNT
-
Constructor Summary
ConstructorDescriptionHashJoinBatch
(HashJoinPOP popConfig, FragmentContext context, RecordBatch left, RecordBatch right) The constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected HashTableConfig
void
dump()
Perform dump of this batch's state to logs.Get the current BatchState (this is useful when performing row key join)Get the current RowKeyJoinState.boolean
Is the next batch of row keys ready to be returnedorg.apache.commons.lang3.tuple.Pair<ValueVector,
Integer> Get the hash table iterator that is created for the build side of the hash join if this hash join was instantiated as a row-key join.void
setBatchState
(AbstractRecordBatch.BatchState newState) Set the BatchState (this is useful when performing row key join)void
setRowKeyJoinState
(RowKeyJoin.RowKeyJoinState newState) Set the RowKeyJoinState (this is useful for maintaining state for row key join algorithm)void
Methods inherited from class org.apache.drill.exec.physical.impl.join.AbstractHashBinaryRecordBatch
buildSchema, cancelIncoming, close, executeBuildPhase, getCalculatorImpl, getRecordCount, innerNext, isSpilledInner, makeDebugString, updateMetrics
Methods inherited from class org.apache.drill.exec.record.AbstractBinaryRecordBatch
checkForEarlyFinish, getBatchMemoryManager, prefetchFirstBatchFromBothSides, updateBatchMemoryManagerStats, verifyOutcomeToSetBatchState
Methods inherited from class org.apache.drill.exec.record.AbstractRecordBatch
cancel, checkContinue, getContainer, getContext, getOutgoingContainer, getPopConfig, getRecordBatchStatsContext, getSchema, getSelectionVector2, getSelectionVector4, getValueAccessorById, getValueVectorId, getWritableBatch, isRecordBatchStatsLoggingEnabled, iterator, next, next, next, schemaChangeException, schemaChangeException
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
HashJoinBatch
public HashJoinBatch(HashJoinPOP popConfig, FragmentContext context, RecordBatch left, RecordBatch right) throws OutOfMemoryException The constructor- Parameters:
popConfig
- HashJoinPOPcontext
- FragmentContextleft
- probe/outer side incoming inputright
- build/iner side incoming input- Throws:
OutOfMemoryException
- out of memory exception
-
-
Method Details
-
createProbe
- Specified by:
createProbe
in classAbstractHashBinaryRecordBatch<HashJoinPOP>
-
setupProbe
- Specified by:
setupProbe
in classAbstractHashBinaryRecordBatch<HashJoinPOP>
- Throws:
SchemaChangeException
-
buildHashTableConfig
- Specified by:
buildHashTableConfig
in classAbstractHashBinaryRecordBatch<HashJoinPOP>
-
dump
public void dump()Description copied from interface:RecordBatch
Perform dump of this batch's state to logs.- Specified by:
dump
in interfaceRecordBatch
-
hasRowKeyBatch
public boolean hasRowKeyBatch()Description copied from interface:RowKeyJoin
Is the next batch of row keys ready to be returned- Specified by:
hasRowKeyBatch
in interfaceRowKeyJoin
- Returns:
- True if ready, false if not
-
getBatchState
Description copied from interface:RowKeyJoin
Get the current BatchState (this is useful when performing row key join)- Specified by:
getBatchState
in interfaceRowKeyJoin
-
setBatchState
Description copied from interface:RowKeyJoin
Set the BatchState (this is useful when performing row key join)- Specified by:
setBatchState
in interfaceRowKeyJoin
-
setRowKeyJoinState
Description copied from interface:RowKeyJoin
Set the RowKeyJoinState (this is useful for maintaining state for row key join algorithm)- Specified by:
setRowKeyJoinState
in interfaceRowKeyJoin
-
getRowKeyJoinState
Description copied from interface:RowKeyJoin
Get the current RowKeyJoinState.- Specified by:
getRowKeyJoinState
in interfaceRowKeyJoin
-
nextRowKeyBatch
Get the hash table iterator that is created for the build side of the hash join if this hash join was instantiated as a row-key join.- Specified by:
nextRowKeyBatch
in interfaceRowKeyJoin
- Returns:
- hash table iterator or null if this hash join was not a row-key join or if it was a row-key join but the build has not yet completed.
-