Class HashJoinBatch
java.lang.Object
org.apache.drill.exec.record.AbstractRecordBatch<HashJoinPOP>
org.apache.drill.exec.record.AbstractBinaryRecordBatch<HashJoinPOP>
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.UpdaterNested classes/interfaces inherited from class org.apache.drill.exec.record.AbstractRecordBatch
AbstractRecordBatch.BatchStateNested classes/interfaces inherited from interface org.apache.drill.exec.record.RecordBatch
RecordBatch.IterOutcomeNested 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, wasKilledFields inherited from class org.apache.drill.exec.record.AbstractBinaryRecordBatch
batchMemoryManager, left, LEFT_INDEX, leftUpstream, numInputs, right, RIGHT_INDEX, rightUpstreamFields inherited from class org.apache.drill.exec.record.AbstractRecordBatch
batchStatsContext, container, context, oContext, state, stats, unionTypeEnabledFields inherited from interface org.apache.drill.exec.record.RecordBatch
MAX_BATCH_ROW_COUNT -
Constructor Summary
ConstructorsConstructorDescriptionHashJoinBatch(HashJoinPOP popConfig, FragmentContext context, RecordBatch left, RecordBatch right) The constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected HashTableConfigvoiddump()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.booleanIs 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.voidsetBatchState(AbstractRecordBatch.BatchState newState) Set the BatchState (this is useful when performing row key join)voidsetRowKeyJoinState(RowKeyJoin.RowKeyJoinState newState) Set the RowKeyJoinState (this is useful for maintaining state for row key join algorithm)voidMethods inherited from class org.apache.drill.exec.physical.impl.join.AbstractHashBinaryRecordBatch
buildSchema, cancelIncoming, close, executeBuildPhase, getCalculatorImpl, getRecordCount, innerNext, isSpilledInner, makeDebugString, updateMetricsMethods inherited from class org.apache.drill.exec.record.AbstractBinaryRecordBatch
checkForEarlyFinish, getBatchMemoryManager, prefetchFirstBatchFromBothSides, updateBatchMemoryManagerStats, verifyOutcomeToSetBatchStateMethods 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, schemaChangeExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
createProbein classAbstractHashBinaryRecordBatch<HashJoinPOP>
-
setupProbe
- Specified by:
setupProbein classAbstractHashBinaryRecordBatch<HashJoinPOP>- Throws:
SchemaChangeException
-
buildHashTableConfig
- Specified by:
buildHashTableConfigin classAbstractHashBinaryRecordBatch<HashJoinPOP>
-
dump
public void dump()Description copied from interface:RecordBatchPerform dump of this batch's state to logs.- Specified by:
dumpin interfaceRecordBatch
-
hasRowKeyBatch
public boolean hasRowKeyBatch()Description copied from interface:RowKeyJoinIs the next batch of row keys ready to be returned- Specified by:
hasRowKeyBatchin interfaceRowKeyJoin- Returns:
- True if ready, false if not
-
getBatchState
Description copied from interface:RowKeyJoinGet the current BatchState (this is useful when performing row key join)- Specified by:
getBatchStatein interfaceRowKeyJoin
-
setBatchState
Description copied from interface:RowKeyJoinSet the BatchState (this is useful when performing row key join)- Specified by:
setBatchStatein interfaceRowKeyJoin- Parameters:
newState-
-
setRowKeyJoinState
Description copied from interface:RowKeyJoinSet the RowKeyJoinState (this is useful for maintaining state for row key join algorithm)- Specified by:
setRowKeyJoinStatein interfaceRowKeyJoin- Parameters:
newState-
-
getRowKeyJoinState
Description copied from interface:RowKeyJoinGet the current RowKeyJoinState.- Specified by:
getRowKeyJoinStatein 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:
nextRowKeyBatchin 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.
-