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
Modifier and TypeClassDescriptionstatic class
static class
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
bindIndex
(ColumnReaderIndex rowIndex) void
bindNullState
(NullStateReader nullStateReader) protected UnsupportedConversionError
conversionError
(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.boolean
byte[]
getBytes()
getDate()
double
float
getFloat()
int
getInt()
long
getLong()
Return the value of the underlying data as a Java object.org.joda.time.Period
getTime()
getValue()
Return the value of the object using the extended type.boolean
isNull()
Determine if this value is null.nullReader
(ColumnMetadata schema) void
type()
The type of this reader.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.accessor.ColumnReader
schema
Methods inherited from interface org.apache.drill.exec.vector.accessor.reader.ReaderEvents
bindBuffer
Methods 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:
bindIndex
in interfaceReaderEvents
-
bindNullState
- Specified by:
bindNullState
in interfaceReaderEvents
-
type
Description copied from interface:ColumnReader
The type of this reader.- Specified by:
type
in interfaceColumnReader
- Returns:
- type of reader
-
extendedType
Description copied from interface:ScalarReader
The 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:
extendedType
in interfaceScalarReader
-
nullStateReader
- Specified by:
nullStateReader
in interfaceReaderEvents
-
reposition
public void reposition()- Specified by:
reposition
in interfaceReaderEvents
-
isNull
public boolean isNull()Description copied from interface:ColumnReader
Determine if this value is null.- Nullable scalar: determine if the value is null.
- Non-nullable scalar: always returns false.
- Arrays: always returns false</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:
isNull
in interfaceColumnReader
- Returns:
- true if this value is null; false otherwise
-
conversionError
-
getBoolean
public boolean getBoolean()- Specified by:
getBoolean
in interfaceScalarReader
-
getInt
public int getInt()- Specified by:
getInt
in interfaceScalarReader
-
getLong
public long getLong()- Specified by:
getLong
in interfaceScalarReader
-
getFloat
public float getFloat()- Specified by:
getFloat
in interfaceScalarReader
-
getDouble
public double getDouble()- Specified by:
getDouble
in interfaceScalarReader
-
getString
- Specified by:
getString
in interfaceScalarReader
-
getBytes
public byte[] getBytes()- Specified by:
getBytes
in interfaceScalarReader
-
getDecimal
- Specified by:
getDecimal
in interfaceScalarReader
-
getPeriod
public org.joda.time.Period getPeriod()- Specified by:
getPeriod
in interfaceScalarReader
-
getDate
- Specified by:
getDate
in interfaceScalarReader
-
getTime
- Specified by:
getTime
in interfaceScalarReader
-
getTimestamp
- Specified by:
getTimestamp
in interfaceScalarReader
-
getObject
Description copied from interface:ColumnReader
Return 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:
getObject
in interfaceColumnReader
- Returns:
- the value as a Java object
-
getValue
Description copied from interface:ScalarReader
Return the value of the object using the extended type.- Specified by:
getValue
in interfaceScalarReader
-
getAsString
Description copied from interface:ColumnReader
Return the entire object as a string. Primarily for debugging.- Specified by:
getAsString
in interfaceColumnReader
- Returns:
- string representation of the object
-