Class AbstractScalarReader
java.lang.Object
org.apache.drill.exec.vector.accessor.reader.AbstractScalarReader
- All Implemented Interfaces:
ColumnReader,ReaderEvents,ScalarReader
- Direct Known Subclasses:
AbstractScalarReader.NullReader,BaseScalarReader
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbindIndex(ColumnReaderIndex rowIndex) voidbindNullState(NullStateReader nullStateReader) protected UnsupportedConversionErrorconversionError(String javaType) The extended type of the value, describes the secondary type for DATE, TIME and TIMESTAMP for which the value type is int or long.Return the entire object as a string.booleanbyte[]getBytes()getDate()doublefloatgetFloat()intgetInt()longgetLong()Return the value of the underlying data as a Java object.org.joda.time.PeriodgetTime()getValue()Return the value of the object using the extended type.booleanisNull()Determine if this value is null.nullReader(ColumnMetadata schema) voidtype()The type of this reader.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.drill.exec.vector.accessor.ColumnReader
schemaMethods inherited from interface org.apache.drill.exec.vector.accessor.reader.ReaderEvents
bindBufferMethods inherited from interface org.apache.drill.exec.vector.accessor.ScalarReader
valueType
-
Field Details
-
vectorIndex
-
nullStateReader
-
-
Constructor Details
-
AbstractScalarReader
public AbstractScalarReader()
-
-
Method Details
-
nullReader
-
bindIndex
- Specified by:
bindIndexin interfaceReaderEvents
-
bindNullState
- Specified by:
bindNullStatein interfaceReaderEvents
-
type
Description copied from interface:ColumnReaderThe type of this reader.- Specified by:
typein interfaceColumnReader- Returns:
- type of reader
-
extendedType
Description copied from interface:ScalarReaderThe extended type of the value, describes the secondary type for DATE, TIME and TIMESTAMP for which the value type is int or long.- Specified by:
extendedTypein interfaceScalarReader
-
nullStateReader
- Specified by:
nullStateReaderin interfaceReaderEvents
-
reposition
public void reposition()- Specified by:
repositionin interfaceReaderEvents
-
isNull
public boolean isNull()Description copied from interface:ColumnReaderDetermine if this value is null.- Nullable scalar: determine if the value is null.
- Non-nullable scalar: always returns false.
- Arrays: always returns falseinvalid input: '<'/tt.>
- Lists: determine if the list for the current row is null. In a list, an array entry can be null, empty, or can contain items. In repeated types, the array itself is never null. If the array is null, then it implicitly has no entries.
- Map or Repeated Map: Always returns false.
- Map inside a union, or in a list that contains a union, the tuple itself can be null.
- Union: Determine if the current value is null. Null values have no type and no associated reader.
- Specified by:
isNullin interfaceColumnReader- Returns:
- true if this value is null; false otherwise
-
conversionError
-
getBoolean
public boolean getBoolean()- Specified by:
getBooleanin interfaceScalarReader
-
getInt
public int getInt()- Specified by:
getIntin interfaceScalarReader
-
getLong
public long getLong()- Specified by:
getLongin interfaceScalarReader
-
getFloat
public float getFloat()- Specified by:
getFloatin interfaceScalarReader
-
getDouble
public double getDouble()- Specified by:
getDoublein interfaceScalarReader
-
getString
- Specified by:
getStringin interfaceScalarReader
-
getBytes
public byte[] getBytes()- Specified by:
getBytesin interfaceScalarReader
-
getDecimal
- Specified by:
getDecimalin interfaceScalarReader
-
getPeriod
public org.joda.time.Period getPeriod()- Specified by:
getPeriodin interfaceScalarReader
-
getDate
- Specified by:
getDatein interfaceScalarReader
-
getTime
- Specified by:
getTimein interfaceScalarReader
-
getTimestamp
- Specified by:
getTimestampin interfaceScalarReader
-
getObject
Description copied from interface:ColumnReaderReturn the value of the underlying data as a Java object. Primarily for testing- Array: Return the entire array as an List of objects. Note, even if the array is scalar, the elements are still returned as a list.
- Specified by:
getObjectin interfaceColumnReader- Returns:
- the value as a Java object
-
getValue
Description copied from interface:ScalarReaderReturn the value of the object using the extended type.- Specified by:
getValuein interfaceScalarReader
-
getAsString
Description copied from interface:ColumnReaderReturn the entire object as a string. Primarily for debugging.- Specified by:
getAsStringin interfaceColumnReader- Returns:
- string representation of the object
-