public interface RowSet
A row set encapsulates a set of vectors and provides access to Drill's
various "views" of vectors: VectorContainer
,
VectorAccessible
, etc. The row set wraps a {#link TupleModel}
which holds the vectors and column metadata. This form is optimized
for easy use in testing; use other implementations for production code.
A row set is defined by a TupleMetadata
. For testing purposes, a row
set has a fixed schema; we don't allow changing the set of vectors
dynamically.
The row set also provides a simple way to write and read records using the
RowSetWriter
and RowSetReader
interfaces. As per Drill
conventions, a row set can be written (once), read many times, and finally
cleared.
Drill provides a large number of vector (data) types. Each requires a
type-specific way to set data. The row set writer uses a
ColumnWriter
to set each value in a way unique to the specific data type. Similarly, the
row set reader provides a ScalarReader
interface. In both cases, columns can be accessed by index number
(as defined in the schema) or by name.
A row set follows a schema. The schema starts as a
BatchSchema
, but is parsed and restructured into a variety of
forms. In the original form, maps contain their value vectors. In the
flattened form, all vectors for all maps (and the top-level tuple) are
collected into a single structure. Since this structure is for testing,
this somewhat-static structure works just file; we don't need the added
complexity that comes from building the schema and data dynamically.
Putting this all together, the typical life-cycle flow is:
SchemaBuilder
.RowSet.ExtendableRowSet.writer(int)
.reader()
.clear()
.Modifier and Type | Interface and Description |
---|---|
static interface |
RowSet.ExtendableRowSet
Single row set which is empty and allows writing.
|
static interface |
RowSet.HyperRowSet
Row set comprised of multiple single row sets, along with
an indirection vector (SV4).
|
static interface |
RowSet.HyperRowSetBuilder |
static interface |
RowSet.SingleRowSet
Row set that manages a single batch of rows.
|
Modifier and Type | Method and Description |
---|---|
BufferAllocator |
allocator() |
BatchSchema |
batchSchema() |
void |
clear() |
VectorContainer |
container() |
BatchSchema.SelectionVectorMode |
indirectionType() |
boolean |
isExtendable() |
boolean |
isWritable() |
void |
print()
Debug-only tool to visualize a row set for inspection.
|
RowSetReader |
reader() |
int |
rowCount() |
TupleMetadata |
schema() |
long |
size()
Return the size in memory of this record set, including indirection
vectors, null vectors, offset vectors and the entire (used and unused)
data vectors.
|
VectorAccessible |
vectorAccessible() |
boolean isExtendable()
boolean isWritable()
VectorAccessible vectorAccessible()
VectorContainer container()
int rowCount()
RowSetReader reader()
void clear()
TupleMetadata schema()
BufferAllocator allocator()
BatchSchema.SelectionVectorMode indirectionType()
void print()
long size()
BatchSchema batchSchema()
Copyright © 1970 The Apache Software Foundation. All rights reserved.