public class MockRecordBatch extends Object implements CloseableRecordBatch
Modifier and Type | Class and Description |
---|---|
static class |
MockRecordBatch.Builder |
RecordBatch.IterOutcome
Modifier and Type | Field and Description |
---|---|
protected BufferAllocator |
allocator |
protected VectorContainer |
container |
protected OperatorContext |
oContext |
protected SelectionVector2 |
sv2 |
protected SelectionVector4 |
sv4 |
MAX_BATCH_ROW_COUNT
Constructor and Description |
---|
MockRecordBatch(FragmentContext context,
OperatorContext oContext,
@NotNull List<VectorContainer> testContainers,
@NotNull List<RecordBatch.IterOutcome> iterOutcomes,
BatchSchema schema) |
MockRecordBatch(FragmentContext context,
OperatorContext oContext,
@NotNull List<VectorContainer> testContainers,
@NotNull List<RecordBatch.IterOutcome> iterOutcomes,
@NotNull List<SelectionVector2> selectionVector2s,
BatchSchema schema)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Informs child operators that no more data is needed.
|
void |
close() |
void |
dump()
Perform dump of this batch's state to logs.
|
VectorContainer |
getContainer()
Return the internal vector container
|
FragmentContext |
getContext()
Gets the FragmentContext of the current query fragment.
|
VectorContainer |
getOutgoingContainer() |
int |
getRecordCount()
Get the number of records.
|
BatchSchema |
getSchema()
Gets the current schema of this record batch.
|
SelectionVector2 |
getSelectionVector2() |
SelectionVector4 |
getSelectionVector4() |
VectorWrapper<?> |
getValueAccessorById(Class<?> clazz,
int... ids) |
TypedFieldId |
getValueVectorId(SchemaPath path)
Gets the value vector type and ID for the given schema path.
|
WritableBatch |
getWritableBatch()
Gets a writable version of this batch.
|
boolean |
isCompleted() |
Iterator<VectorWrapper<?>> |
iterator() |
RecordBatch.IterOutcome |
next()
Updates the data in each Field reading interface for the next range of
records.
|
void |
useUnnestKillHandlingForLimit(boolean limitWithUnnest) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
protected VectorContainer container
protected SelectionVector2 sv2
protected SelectionVector4 sv4
protected final OperatorContext oContext
protected final BufferAllocator allocator
public MockRecordBatch(@Nullable FragmentContext context, @Nullable OperatorContext oContext, @NotNull @NotNull List<VectorContainer> testContainers, @NotNull @NotNull List<RecordBatch.IterOutcome> iterOutcomes, BatchSchema schema)
@Deprecated public MockRecordBatch(@Nullable FragmentContext context, @Nullable OperatorContext oContext, @NotNull @NotNull List<VectorContainer> testContainers, @NotNull @NotNull List<RecordBatch.IterOutcome> iterOutcomes, @NotNull @NotNull List<SelectionVector2> selectionVector2s, BatchSchema schema)
public void close()
close
in interface AutoCloseable
public SelectionVector2 getSelectionVector2()
getSelectionVector2
in interface VectorAccessible
public SelectionVector4 getSelectionVector4()
getSelectionVector4
in interface VectorAccessible
public FragmentContext getContext()
RecordBatch
getContext
in interface RecordBatch
public BatchSchema getSchema()
RecordBatch
May be called only when the most recent call to RecordBatch.next()
, if any,
returned RecordBatch.IterOutcome.OK_NEW_SCHEMA
or RecordBatch.IterOutcome.OK
.
The schema changes when and only when RecordBatch.next()
returns
RecordBatch.IterOutcome.OK_NEW_SCHEMA
.
getSchema
in interface RecordBatch
getSchema
in interface VectorAccessible
public int getRecordCount()
VectorAccessible
getRecordCount
in interface VectorAccessible
public void cancel()
RecordBatch
The operator which triggers the cancel MUST send a NONE
status downstream, or throw an exception. It is not legal to
call next()
on an operator after calling its
cancel()
method.
cancel
in interface RecordBatch
public VectorContainer getOutgoingContainer()
getOutgoingContainer
in interface RecordBatch
public TypedFieldId getValueVectorId(SchemaPath path)
RecordBatch
Iterable<ValueVector>
.getValueVectorId
in interface RecordBatch
getValueVectorId
in interface VectorAccessible
path
- The path where the vector should be located.public VectorWrapper<?> getValueAccessorById(Class<?> clazz, int... ids)
getValueAccessorById
in interface RecordBatch
getValueAccessorById
in interface VectorAccessible
public RecordBatch.IterOutcome next()
RecordBatch
Once a RecordBatch's next()
has returned RecordBatch.IterOutcome.NONE
or IterOutcome#STOP
, the consumer should no longer call
next()
. Behavior at this point is undefined and likely to
throw an exception.
See RecordBatch.IterOutcome
for the protocol (possible sequences of return
values).
next
in interface RecordBatch
public WritableBatch getWritableBatch()
RecordBatch
getWritableBatch
in interface RecordBatch
public Iterator<VectorWrapper<?>> iterator()
iterator
in interface Iterable<VectorWrapper<?>>
public VectorContainer getContainer()
RecordBatch
getContainer
in interface RecordBatch
public boolean isCompleted()
public void useUnnestKillHandlingForLimit(boolean limitWithUnnest)
public void dump()
RecordBatch
dump
in interface RecordBatch
Copyright © 2021 The Apache Software Foundation. All rights reserved.