Class SingleDictReaderImpl
- All Implemented Interfaces:
Iterable<String>
,Positionable
,BaseReader
,BaseReader.DictReader
,BaseReader.ListReader
,BaseReader.MapReader
,BaseReader.RepeatedListReader
,BaseReader.RepeatedMapReader
,BaseReader.ScalarReader
,BigIntReader
,BitReader
,DateReader
,Decimal18Reader
,Decimal28DenseReader
,Decimal28SparseReader
,Decimal38DenseReader
,Decimal38SparseReader
,Decimal9Reader
,FieldReader
,Float4Reader
,Float8Reader
,IntervalDayReader
,IntervalReader
,IntervalYearReader
,IntReader
,RepeatedBigIntReader
,RepeatedBitReader
,RepeatedDateReader
,RepeatedDecimal18Reader
,RepeatedDecimal28DenseReader
,RepeatedDecimal28SparseReader
,RepeatedDecimal38DenseReader
,RepeatedDecimal38SparseReader
,RepeatedDecimal9Reader
,RepeatedFloat4Reader
,RepeatedFloat8Reader
,RepeatedIntervalDayReader
,RepeatedIntervalReader
,RepeatedIntervalYearReader
,RepeatedIntReader
,RepeatedSmallIntReader
,RepeatedTimeReader
,RepeatedTimeStampReader
,RepeatedTinyIntReader
,RepeatedUInt1Reader
,RepeatedUInt2Reader
,RepeatedUInt4Reader
,RepeatedUInt8Reader
,RepeatedVar16CharReader
,RepeatedVarBinaryReader
,RepeatedVarCharReader
,RepeatedVarDecimalReader
,SmallIntReader
,TimeReader
,TimeStampReader
,TinyIntReader
,UInt1Reader
,UInt2Reader
,UInt4Reader
,UInt8Reader
,Var16CharReader
,VarBinaryReader
,VarCharReader
,VarDecimalReader
,UntypedReader
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.drill.exec.vector.complex.reader.BaseReader
BaseReader.ComplexReader, BaseReader.DictReader, BaseReader.ListReader, BaseReader.MapReader, BaseReader.RepeatedListReader, BaseReader.RepeatedMapReader, BaseReader.ScalarReader
-
Field Summary
Fields inherited from class org.apache.drill.exec.vector.complex.impl.AbstractRepeatedMapReaderImpl
currentOffset, fields, maxOffset, NO_VALUES, vector
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
copyAsValue
(UnionWriter writer) void
copyAsValue
(BaseWriter.DictWriter writer) void
copyAsValue
(BaseWriter.ListWriter writer) int
find
(int key) Obtain the index for given key in current row used to find a corresponding value with.int
Obtain the index for given key in current row used to find a corresponding value with.int
Obtain the index for given key in current row used to find a corresponding value with.getField()
ReturnsString
representation of the reader's type.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 akey
into theholder
.void
read
(Object key, ValueHolder holder) Reads a value corresponding to akey
into theholder
.void
read
(String key, ValueHolder holder) Reads a value corresponding to akey
into theholder
.void
read
(UnionHolder holder) void
read
(UntypedNullHolder holder) void
setPosition
(int index) Methods inherited from class org.apache.drill.exec.vector.complex.impl.AbstractRepeatedMapReaderImpl
getType, isEmpty, isSet, iterator, next, readObject, reset, size
Methods inherited from class org.apache.drill.exec.vector.complex.impl.AbstractFieldReader
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.drill.exec.vector.complex.reader.BaseReader
copyAsValue, getField, getType, read, read, read, reset
Methods inherited from interface org.apache.drill.exec.vector.complex.reader.BaseReader.RepeatedMapReader
copyAsValue, next, size
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface org.apache.drill.exec.vector.UntypedReader
read
-
Field Details
-
NOT_FOUND
public static final int NOT_FOUND- See Also:
-
-
Constructor Details
-
SingleDictReaderImpl
-
-
Method Details
-
reader
- Specified by:
reader
in interfaceBaseReader.MapReader
- Overrides:
reader
in classAbstractRepeatedMapReaderImpl<DictVector>
-
find
Description copied from interface:BaseReader.DictReader
Obtain the index for given key in current row used to find a corresponding value with. Used in generated code when retrieving value from Dict withPathSegment.NameSegment
in cases whenDictVector.getValueType()
is complex.Despite
key
is passed asString
the value is converted to actual type based onDictVector.getKeyType()
.- Specified by:
find
in interfaceBaseReader.DictReader
- Overrides:
find
in classAbstractFieldReader
- Parameters:
key
- literal representing key value- Returns:
- index for the given key
- See Also:
-
find
public int find(int key) Description copied from interface:BaseReader.DictReader
Obtain the index for given key in current row used to find a corresponding value with. Used in generated code when retrieving value from Dict withPathSegment.ArraySegment
in cases whenDictVector.getValueType()
is complex.Despite
key
is passed asint
the value is converted to actual type based onDictVector.getKeyType()
.- Specified by:
find
in interfaceBaseReader.DictReader
- Overrides:
find
in classAbstractFieldReader
- Parameters:
key
- literal representing key value- Returns:
- index for the given key
- See Also:
-
find
Description copied from interface:BaseReader.DictReader
Obtain the index for given key in current row used to find a corresponding value with. Used in generated code when retrieving value from Dict usingPathSegment
with providedPathSegment.getOriginalValue()
in cases whenDictVector.getValueType()
is complex.The
key
is assumed to be of actual type, is not converted and used as is.- Specified by:
find
in interfaceBaseReader.DictReader
- Overrides:
find
in classAbstractFieldReader
- Parameters:
key
- key value- Returns:
- index for the given key
- See Also:
-
read
Description copied from interface:BaseReader.DictReader
Reads a value corresponding to akey
into theholder
. If there is no entry in the row with the givenkey
, value is set to null.Used in generated code when retrieving value from Dict with
PathSegment.NameSegment
in cases whenDictVector.getValueType()
is primitive.Despite
key
is passed asString
the value is converted to actual type based onDictVector.getKeyType()
.- Specified by:
read
in interfaceBaseReader.DictReader
- Overrides:
read
in classAbstractFieldReader
- Parameters:
key
- literal representing key valueholder
- a holder to write value's value into- See Also:
-
read
Description copied from interface:BaseReader.DictReader
Reads a value corresponding to akey
into theholder
. If there is no entry in the row with the givenkey
, value is set to null.Used in generated code when retrieving value from Dict with
PathSegment.ArraySegment
in cases whenDictVector.getValueType()
is primitive.Despite
key
is passed asint
the value is converted to actual type based onDictVector.getKeyType()
.- Specified by:
read
in interfaceBaseReader.DictReader
- Overrides:
read
in classAbstractFieldReader
- Parameters:
key
- literal representing key valueholder
- a holder to write value's value into- See Also:
-
read
Description copied from interface:BaseReader.DictReader
Reads a value corresponding to akey
into theholder
. If there is no entry in the row with the givenkey
, value is set to null.Used in generated code when retrieving value from Dict using
PathSegment
with providedPathSegment.getOriginalValue()
in cases whenDictVector.getValueType()
is primitive.The
key
is assumed to be of actual type, is not converted and used as is.- Specified by:
read
in interfaceBaseReader.DictReader
- Overrides:
read
in classAbstractFieldReader
- Parameters:
key
- key valueholder
- a holder to write value's value into- See Also:
-
setPosition
public void setPosition(int index) - Specified by:
setPosition
in interfacePositionable
- Overrides:
setPosition
in classAbstractRepeatedMapReaderImpl<DictVector>
-
copyAsValue
- Specified by:
copyAsValue
in interfaceBaseReader.DictReader
- Overrides:
copyAsValue
in classAbstractFieldReader
-
copyAsValue
- Specified by:
copyAsValue
in interfaceBaseReader.RepeatedListReader
-
getTypeString
Description copied from interface:BaseReader
ReturnsString
representation of the reader's type. In case ifBaseReader.getType()
is primitive, the method is equivalent to {@link #getType().getMinorType().name()}. If the reader has minor type equal toTypeProtos.MinorType.DICT
,DICT<keyMinorType,valueMinorType>
, withkeyMinorType
andvalueMinorType
being key's and value's minor types respectively, will be returned. Used intypeOf
UDF.- Specified by:
getTypeString
in interfaceBaseReader
- Returns:
String
representation of reader's type.
-
getVectorType
Description copied from interface:BaseReader
Returns the type of the vector, not value. For all vectors, this is the same as the vector's getField().getType().getMinorType(). It is used to report the actual vector type in the getDrillType() function.- Specified by:
getVectorType
in interfaceBaseReader
- Overrides:
getVectorType
in classAbstractFieldReader
-
getField
- Specified by:
getField
in interfaceBaseReader
-
read
- Specified by:
read
in interfaceBaseReader
-
read
- Specified by:
read
in interfaceBaseReader
-
read
- Specified by:
read
in interfaceUntypedReader
-
copyAsValue
- Specified by:
copyAsValue
in interfaceBaseReader
-