Class SpilledRecordBatch
java.lang.Object
org.apache.drill.exec.physical.impl.aggregate.SpilledRecordBatch
- All Implemented Interfaces:
AutoCloseable
,Iterable<VectorWrapper<?>>
,CloseableRecordBatch
,RecordBatch
,VectorAccessible
Replaces "incoming" - instead scanning a spilled partition file
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.drill.exec.record.RecordBatch
RecordBatch.IterOutcome
-
Field Summary
Fields inherited from interface org.apache.drill.exec.record.RecordBatch
MAX_BATCH_ROW_COUNT
-
Constructor Summary
ConstructorDescriptionSpilledRecordBatch
(String spillFile, int spilledBatches, FragmentContext context, BatchSchema schema, OperatorContext oContext, SpillSet spillSet) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Informs child operators that no more data is needed.void
close()
Note: ignoring any IO errors (e.g.void
dump()
Perform dump of this batch's state to logs.Return the internal vector containerGets the FragmentContext of the current query fragment.Return the initial outcome (from the first next() call )int
Get the number of records.Gets the current schema of this record batch.getValueAccessorById
(Class<?> clazz, int... ids) getValueVectorId
(SchemaPath path) Gets the value vector type and ID for the given schema path.Gets a writable version of this batch.iterator()
next()
Read the next batch from the spill fileMethods 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
-
SpilledRecordBatch
public SpilledRecordBatch(String spillFile, int spilledBatches, FragmentContext context, BatchSchema schema, OperatorContext oContext, SpillSet spillSet)
-
-
Method Details
-
getSelectionVector2
- Specified by:
getSelectionVector2
in interfaceVectorAccessible
-
getSelectionVector4
- Specified by:
getSelectionVector4
in interfaceVectorAccessible
-
getValueVectorId
Description copied from interface:RecordBatch
Gets the value vector type and ID for the given schema path. The TypedFieldId should store a fieldId which is the same as the ordinal position of the field within the Iterator provided this class's implementation ofIterable<ValueVector>
.- Specified by:
getValueVectorId
in interfaceRecordBatch
- Specified by:
getValueVectorId
in interfaceVectorAccessible
- Parameters:
path
- The path where the vector should be located.- Returns:
- The local field id associated with this vector. If no field matches this path, this will return a null TypedFieldId
-
getValueAccessorById
- Specified by:
getValueAccessorById
in interfaceRecordBatch
- Specified by:
getValueAccessorById
in interfaceVectorAccessible
-
iterator
- Specified by:
iterator
in interfaceIterable<VectorWrapper<?>>
-
getContext
Description copied from interface:RecordBatch
Gets the FragmentContext of the current query fragment. Useful for reporting failure information or other query-level information.- Specified by:
getContext
in interfaceRecordBatch
-
getSchema
Description copied from interface:RecordBatch
Gets the current schema of this record batch.May be called only when the most recent call to
RecordBatch.next()
, if any, returnedRecordBatch.IterOutcome.OK_NEW_SCHEMA
orRecordBatch.IterOutcome.OK
.The schema changes when and only when
RecordBatch.next()
returnsRecordBatch.IterOutcome.OK_NEW_SCHEMA
.- Specified by:
getSchema
in interfaceRecordBatch
- Specified by:
getSchema
in interfaceVectorAccessible
- Returns:
- schema of the current batch
-
getWritableBatch
Description copied from interface:RecordBatch
Gets a writable version of this batch. Takes over ownership of existing buffers.- Specified by:
getWritableBatch
in interfaceRecordBatch
-
getOutgoingContainer
- Specified by:
getOutgoingContainer
in interfaceRecordBatch
-
getContainer
Description copied from interface:RecordBatch
Return the internal vector container- Specified by:
getContainer
in interfaceRecordBatch
- Returns:
- The internal vector container
-
getRecordCount
public int getRecordCount()Description copied from interface:VectorAccessible
Get the number of records.- Specified by:
getRecordCount
in interfaceVectorAccessible
- Returns:
- number of records
-
cancel
public void cancel()Description copied from interface:RecordBatch
Informs child operators that no more data is needed. Only called for "normal" cancellation to avoid unnecessary compute in any worker threads. For the error case, the fragment executor will call close() on each child automatically.The operator which triggers the cancel MUST send a
NONE
status downstream, or throw an exception. It is not legal to callnext()
on an operator after calling itscancel()
method.- Specified by:
cancel
in interfaceRecordBatch
-
next
Read the next batch from the spill file- Specified by:
next
in interfaceRecordBatch
- Returns:
- IterOutcome
-
getInitialOutcome
Return the initial outcome (from the first next() call ) -
dump
public void dump()Description copied from interface:RecordBatch
Perform dump of this batch's state to logs.- Specified by:
dump
in interfaceRecordBatch
-
close
public void close()Note: ignoring any IO errors (e.g. file not found)- Specified by:
close
in interfaceAutoCloseable
-