public interface VariantReader extends ColumnReader
At read time, the set of possible types is fixed. A request to obtain a reader for an unused type returns a null pointer.
This reader is essentially a map of types: it allows access to type-specific readers for the set of types supported in the current vector. A client checks the type of each value, then uses the proper type-specific reader to access that value.
VariantWriter}
Modifier and Type | Method and Description |
---|---|
ArrayReader |
array() |
TypeProtos.MinorType |
dataType()
Return the data type of the current value.
|
boolean |
hasType(TypeProtos.MinorType type)
Determine if a given type is supported by the union vector
for some value in the result set.
|
ObjectReader |
member()
Return the reader for the member type of the current row.
|
ObjectReader |
member(TypeProtos.MinorType type)
Return the member reader for the given type.
|
ScalarReader |
scalar()
Return the appropriate scalar reader for the current value.
|
ScalarReader |
scalar(TypeProtos.MinorType type)
Return the scalar reader for the given type member.
|
int |
size() |
TupleReader |
tuple() |
VariantMetadata |
variantSchema() |
getAsString, getObject, isNull, schema, type
VariantMetadata variantSchema()
int size()
boolean hasType(TypeProtos.MinorType type)
type
- the Drill minor type to queryObjectReader member(TypeProtos.MinorType type)
type
- member typeScalarReader scalar(TypeProtos.MinorType type)
type
- member typeTypeProtos.MinorType dataType()
ObjectReader member()
ScalarReader scalar()
ColumnReader.isNull()
returns true,
else the equivalent of scalar
(
dataType()
)IllegalStateException
- if called for a variant that
holds a tuple or an arrayTupleReader tuple()
ArrayReader array()
Copyright © 1970 The Apache Software Foundation. All rights reserved.