Class LateralJoinBatch
java.lang.Object
org.apache.drill.exec.record.AbstractRecordBatch<LateralJoinPOP>
org.apache.drill.exec.record.AbstractBinaryRecordBatch<LateralJoinPOP>
org.apache.drill.exec.physical.impl.join.LateralJoinBatch
- All Implemented Interfaces:
- AutoCloseable,- Iterable<VectorWrapper<?>>,- LateralContract,- CloseableRecordBatch,- RecordBatch,- VectorAccessible
public class LateralJoinBatch
extends AbstractBinaryRecordBatch<LateralJoinPOP>
implements LateralContract
RecordBatch implementation for the lateral join operator. Currently it's
 expected LATERAL to co-exists with UNNEST operator. Both LATERAL and UNNEST
 will share a contract with each other defined at 
LateralContract.- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.drill.exec.record.AbstractBinaryRecordBatchAbstractBinaryRecordBatch.MetricNested classes/interfaces inherited from class org.apache.drill.exec.record.AbstractRecordBatchAbstractRecordBatch.BatchStateNested classes/interfaces inherited from interface org.apache.drill.exec.record.RecordBatchRecordBatch.IterOutcome
- 
Field SummaryFields inherited from class org.apache.drill.exec.record.AbstractBinaryRecordBatchbatchMemoryManager, left, LEFT_INDEX, leftUpstream, numInputs, right, RIGHT_INDEX, rightUpstreamFields inherited from class org.apache.drill.exec.record.AbstractRecordBatchbatchStatsContext, container, context, oContext, popConfig, state, stats, unionTypeEnabledFields inherited from interface org.apache.drill.exec.record.RecordBatchMAX_BATCH_ROW_COUNT
- 
Constructor SummaryConstructorsConstructorDescriptionLateralJoinBatch(LateralJoinPOP popConfig, FragmentContext context, RecordBatch left, RecordBatch right) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidPrefetch a batch from left and right branch to know about the schema of each side.protected voidvoidclose()voiddump()Perform dump of this batch's state to logs.Returns the left side incoming for the Lateral Join.Returns the currentRecordBatch.IterOutcomefor the left incoming batchintGet the number of records.intReturns the current row index which the calling operator should process in current incoming left record batch.Gets the left and right incoming batch and produce the output batch.protected booleanGet the left and right batch during build schema phase forLateralJoinBatch.voidsetMaxOutputRowCount(int outputRowCount) Used only for testing for cases when multiple output batches are produced for same input setvoidsetUseMemoryManager(boolean useMemoryManager) Used only for testing to disable output batch calculation using memory manager and instead use the static max value set bysetMaxOutputRowCount(int)Methods inherited from class org.apache.drill.exec.record.AbstractBinaryRecordBatchcheckForEarlyFinish, getBatchMemoryManager, updateBatchMemoryManagerStats, verifyOutcomeToSetBatchStateMethods inherited from class org.apache.drill.exec.record.AbstractRecordBatchcancel, checkContinue, getContainer, getContext, getOutgoingContainer, getPopConfig, getRecordBatchStatsContext, getSchema, getSelectionVector2, getSelectionVector4, getValueAccessorById, getValueVectorId, getWritableBatch, isRecordBatchStatsLoggingEnabled, iterator, next, next, next, schemaChangeException, schemaChangeExceptionMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Constructor Details- 
LateralJoinBatchpublic LateralJoinBatch(LateralJoinPOP popConfig, FragmentContext context, RecordBatch left, RecordBatch right) throws OutOfMemoryException - Throws:
- OutOfMemoryException
 
 
- 
- 
Method Details- 
innerNextGets the left and right incoming batch and produce the output batch. If the left incoming batch is empty then next on right branch is not called and empty batch with correct outcome is returned. If non empty left incoming batch is received then it call's next on right branch to get an incoming and finally produces output.- Specified by:
- innerNextin class- AbstractRecordBatch<LateralJoinPOP>
- Returns:
- IterOutcome state of the lateral join batch
 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
- Overrides:
- closein class- AbstractRecordBatch<LateralJoinPOP>
 
- 
getRecordCountpublic int getRecordCount()Description copied from interface:VectorAccessibleGet the number of records.- Specified by:
- getRecordCountin interface- VectorAccessible
- Returns:
- number of records
 
- 
getIncomingReturns the left side incoming for the Lateral Join. Used by right branch leaf operator of Lateral to process the records atleftJoinIndex.- Specified by:
- getIncomingin interface- LateralContract
- Returns:
- - RecordBatch received as left side incoming
 
- 
getRecordIndexpublic int getRecordIndex()Returns the current row index which the calling operator should process in current incoming left record batch. LATERAL should never return it as -1 since that indicated current left batch is empty and LATERAL will never call next on right side with empty left batch- Specified by:
- getRecordIndexin interface- LateralContract
- Returns:
- - int - index of row to process.
 
- 
getLeftOutcomeReturns the currentRecordBatch.IterOutcomefor the left incoming batch- Specified by:
- getLeftOutcomein interface- LateralContract
- Returns:
- The current outcome of left incoming batch.
 
- 
prefetchFirstBatchFromBothSidesprotected boolean prefetchFirstBatchFromBothSides()Get the left and right batch during build schema phase forLateralJoinBatch. If left batch sees a failure outcome then we don't even call next on right branch, since there is no left incoming.- Overrides:
- prefetchFirstBatchFromBothSidesin class- AbstractBinaryRecordBatch<LateralJoinPOP>
- Returns:
- true if both the left/right batch was received without failure outcome. false if either of batch is received with failure outcome.
 
- 
buildSchemaprotected void buildSchema()Prefetch a batch from left and right branch to know about the schema of each side. Then adds value vector in output container based on those schemas. For this phase LATERAL always expect's an empty batch from right side which UNNEST should abide by.- Overrides:
- buildSchemain class- AbstractRecordBatch<LateralJoinPOP>
- Throws:
- SchemaChangeException- if batch schema was changed during execution
 
- 
cancelIncomingprotected void cancelIncoming()- Overrides:
- cancelIncomingin class- AbstractBinaryRecordBatch<LateralJoinPOP>
 
- 
setMaxOutputRowCountpublic void setMaxOutputRowCount(int outputRowCount) Used only for testing for cases when multiple output batches are produced for same input set- Parameters:
- outputRowCount- - Max rows that output batch can hold
 
- 
setUseMemoryManagerpublic void setUseMemoryManager(boolean useMemoryManager) Used only for testing to disable output batch calculation using memory manager and instead use the static max value set bysetMaxOutputRowCount(int)- Parameters:
- useMemoryManager- - false - disable memory manager update to take effect, true enable memory manager update
 
- 
dumppublic void dump()Description copied from interface:RecordBatchPerform dump of this batch's state to logs.- Specified by:
- dumpin interface- RecordBatch
 
 
-