@PublicEvolving public interface ArrayData
ArrayType
.
Note: All elements of this data structure must be internal data structures and must be of the
same type. See RowData
for more information about internal data structures.
Use GenericArrayData
to construct instances of this interface from regular Java
arrays.
Modifier and Type | Interface and Description |
---|---|
static interface |
ArrayData.ElementGetter
Accessor for getting the elements of an array during runtime.
|
Modifier and Type | Method and Description |
---|---|
static ArrayData.ElementGetter |
createElementGetter(LogicalType elementType)
Creates an accessor for getting elements in an internal array data structure at the given
position.
|
ArrayData |
getArray(int pos)
Returns the array value at the given position.
|
byte[] |
getBinary(int pos)
Returns the binary value at the given position.
|
boolean |
getBoolean(int pos)
Returns the boolean value at the given position.
|
byte |
getByte(int pos)
Returns the byte value at the given position.
|
DecimalData |
getDecimal(int pos,
int precision,
int scale)
Returns the decimal value at the given position.
|
double |
getDouble(int pos)
Returns the double value at the given position.
|
float |
getFloat(int pos)
Returns the float value at the given position.
|
int |
getInt(int pos)
Returns the integer value at the given position.
|
long |
getLong(int pos)
Returns the long value at the given position.
|
MapData |
getMap(int pos)
Returns the map value at the given position.
|
<T> RawValueData<T> |
getRawValue(int pos)
Returns the raw value at the given position.
|
RowData |
getRow(int pos,
int numFields)
Returns the row value at the given position.
|
short |
getShort(int pos)
Returns the short value at the given position.
|
StringData |
getString(int pos)
Returns the string value at the given position.
|
TimestampData |
getTimestamp(int pos,
int precision)
Returns the timestamp value at the given position.
|
boolean |
isNullAt(int pos)
Returns true if the element is null at the given position.
|
int |
size()
Returns the number of elements in this array.
|
boolean[] |
toBooleanArray() |
byte[] |
toByteArray() |
double[] |
toDoubleArray() |
float[] |
toFloatArray() |
int[] |
toIntArray() |
long[] |
toLongArray() |
short[] |
toShortArray() |
int size()
boolean isNullAt(int pos)
boolean getBoolean(int pos)
byte getByte(int pos)
short getShort(int pos)
int getInt(int pos)
long getLong(int pos)
float getFloat(int pos)
double getDouble(int pos)
StringData getString(int pos)
DecimalData getDecimal(int pos, int precision, int scale)
The precision and scale are required to determine whether the decimal value was stored in
a compact representation (see DecimalData
).
TimestampData getTimestamp(int pos, int precision)
The precision is required to determine whether the timestamp value was stored in a compact
representation (see TimestampData
).
<T> RawValueData<T> getRawValue(int pos)
byte[] getBinary(int pos)
ArrayData getArray(int pos)
MapData getMap(int pos)
RowData getRow(int pos, int numFields)
The number of fields is required to correctly extract the row.
boolean[] toBooleanArray()
byte[] toByteArray()
short[] toShortArray()
int[] toIntArray()
long[] toLongArray()
float[] toFloatArray()
double[] toDoubleArray()
static ArrayData.ElementGetter createElementGetter(LogicalType elementType)
elementType
- the element type of the arrayCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.