public class SingleDictReaderImpl extends AbstractRepeatedMapReaderImpl<DictVector> implements BaseReader.DictReader
BaseReader.ComplexReader, BaseReader.DictReader, BaseReader.ListReader, BaseReader.MapReader, BaseReader.RepeatedListReader, BaseReader.RepeatedMapReader, BaseReader.ScalarReader
Modifier and Type | Field and Description |
---|---|
static int |
NOT_FOUND |
currentOffset, fields, maxOffset, NO_VALUES, vector
Constructor and Description |
---|
SingleDictReaderImpl(DictVector vector) |
Modifier and Type | Method and Description |
---|---|
void |
copyAsValue(BaseWriter.DictWriter writer) |
void |
copyAsValue(BaseWriter.ListWriter writer) |
void |
copyAsValue(UnionWriter writer) |
int |
find(int key)
Obtain the index for given key in current row used to find a corresponding value with.
|
int |
find(Object key)
Obtain the index for given key in current row used to find a corresponding value with.
|
int |
find(String key)
Obtain the index for given key in current row used to find a corresponding value with.
|
MaterializedField |
getField() |
String |
getTypeString()
Returns
String representation of the reader's type. |
TypeProtos.MinorType |
getVectorType()
Returns the type of the vector, not value.
|
void |
read(int index,
UnionHolder holder) |
void |
read(int key,
ValueHolder holder)
Reads a value corresponding to a
key into the holder . |
void |
read(Object key,
ValueHolder holder)
Reads a value corresponding to a
key into the holder . |
void |
read(String key,
ValueHolder holder)
Reads a value corresponding to a
key into the holder . |
void |
read(UnionHolder holder) |
void |
read(UntypedNullHolder holder) |
FieldReader |
reader(String name) |
void |
setPosition(int index) |
getType, isEmpty, isSet, iterator, next, readObject, reset, size
copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsField, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, copyAsValue, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, readBigDecimal, readBigDecimal, readBoolean, readBoolean, readByte, readByte, readByteArray, readByteArray, readCharacter, readCharacter, readDouble, readDouble, reader, readFloat, readFloat, readInteger, readInteger, readLocalDate, readLocalDate, readLocalDateTime, readLocalDateTime, readLocalTime, readLocalTime, readLong, readLong, readObject, readPeriod, readPeriod, readShort, readShort, readString, readString, readText, readText
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
copyAsValue, next, size
copyAsValue, getField, getType, isSet, read, read, read, reset
forEach, iterator, spliterator
read
public static final int NOT_FOUND
public SingleDictReaderImpl(DictVector vector)
public FieldReader reader(String name)
reader
in interface BaseReader.MapReader
reader
in class AbstractRepeatedMapReaderImpl<DictVector>
public int find(String key)
BaseReader.DictReader
PathSegment.NameSegment
in cases when DictVector.getValueType()
is complex.
Despite key
is passed as String
the value is converted to
actual type based on DictVector.getKeyType()
.
find
in interface BaseReader.DictReader
find
in class AbstractFieldReader
key
- literal representing key valueDictVector
public int find(int key)
BaseReader.DictReader
PathSegment.ArraySegment
in cases when DictVector.getValueType()
is complex.
Despite key
is passed as int
the value is converted to
actual type based on DictVector.getKeyType()
.
find
in interface BaseReader.DictReader
find
in class AbstractFieldReader
key
- literal representing key valueDictVector
public int find(Object key)
BaseReader.DictReader
PathSegment
with provided PathSegment.getOriginalValue()
in cases when DictVector.getValueType()
is complex.
The key
is assumed to be of actual type, is not converted and used as is.
find
in interface BaseReader.DictReader
find
in class AbstractFieldReader
key
- key valueDictVector
public void read(String key, ValueHolder holder)
BaseReader.DictReader
key
into the holder
.
If there is no entry in the row with the given key
, value is set to null.
Used in generated code when retrieving value from Dict with
PathSegment.NameSegment
in cases when DictVector.getValueType()
is primitive.
Despite key
is passed as String
the value is converted to
actual type based on DictVector.getKeyType()
.
read
in interface BaseReader.DictReader
read
in class AbstractFieldReader
key
- literal representing key valueholder
- a holder to write value's value intoDictVector
public void read(int key, ValueHolder holder)
BaseReader.DictReader
key
into the holder
.
If there is no entry in the row with the given key
, value is set to null.
Used in generated code when retrieving value from Dict with
PathSegment.ArraySegment
in cases when DictVector.getValueType()
is primitive.
Despite key
is passed as int
the value is converted to
actual type based on DictVector.getKeyType()
.
read
in interface BaseReader.DictReader
read
in class AbstractFieldReader
key
- literal representing key valueholder
- a holder to write value's value intoDictVector
public void read(Object key, ValueHolder holder)
BaseReader.DictReader
key
into the holder
.
If there is no entry in the row with the given key
, value is set to null.
Used in generated code when retrieving value from Dict using PathSegment
with provided PathSegment.getOriginalValue()
in cases when DictVector.getValueType()
is primitive.
The key
is assumed to be of actual type, is not converted and used as is.
read
in interface BaseReader.DictReader
read
in class AbstractFieldReader
key
- key valueholder
- a holder to write value's value intoDictVector
public void setPosition(int index)
setPosition
in interface Positionable
setPosition
in class AbstractRepeatedMapReaderImpl<DictVector>
public void copyAsValue(BaseWriter.DictWriter writer)
copyAsValue
in interface BaseReader.DictReader
copyAsValue
in class AbstractFieldReader
public void copyAsValue(BaseWriter.ListWriter writer)
copyAsValue
in interface BaseReader.RepeatedListReader
public String getTypeString()
BaseReader
String
representation of the reader's type. In case if
BaseReader.getType()
is primitive, the method is equivalent to
#getType().getMinorType().name()
. If the reader has minor type
equal to TypeProtos.MinorType.DICT
,
DICT<keyMinorType,valueMinorType>
, with keyMinorType
and valueMinorType
being key's and value's minor types
respectively, will be returned. Used in typeOf
UDF.getTypeString
in interface BaseReader
String
representation of reader's type.public TypeProtos.MinorType getVectorType()
BaseReader
getVectorType
in interface BaseReader
getVectorType
in class AbstractFieldReader
public MaterializedField getField()
getField
in interface BaseReader
public void read(UnionHolder holder)
read
in interface BaseReader
public void read(int index, UnionHolder holder)
read
in interface BaseReader
public void read(UntypedNullHolder holder)
read
in interface UntypedReader
public void copyAsValue(UnionWriter writer)
copyAsValue
in interface BaseReader
Copyright © 1970 The Apache Software Foundation. All rights reserved.