Package org.apache.flink.table.data
Interface ArrayData
- All Known Implementing Classes:
BinaryArrayData,ColumnarArrayData,GenericArrayData
@PublicEvolving
public interface ArrayData
Base interface of an internal data structure representing data of
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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAccessor for getting the elements of an array during runtime. -
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayData.ElementGettercreateElementGetter(LogicalType elementType) Creates an accessor for getting elements in an internal array data structure at the given position.getArray(int pos) Returns the array value at the given position.byte[]getBinary(int pos) Returns the binary value at the given position.booleangetBoolean(int pos) Returns the boolean value at the given position.bytegetByte(int pos) Returns the byte value at the given position.getDecimal(int pos, int precision, int scale) Returns the decimal value at the given position.doublegetDouble(int pos) Returns the double value at the given position.floatgetFloat(int pos) Returns the float value at the given position.intgetInt(int pos) Returns the integer value at the given position.longgetLong(int pos) Returns the long value at the given position.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.getRow(int pos, int numFields) Returns the row value at the given position.shortgetShort(int pos) Returns the short value at the given position.getString(int pos) Returns the string value at the given position.getTimestamp(int pos, int precision) Returns the timestamp value at the given position.booleanisNullAt(int pos) Returns true if the element is null at the given position.intsize()Returns the number of elements in this array.boolean[]byte[]double[]float[]int[]long[]short[]
-
Method Details
-
size
int size()Returns the number of elements in this array. -
isNullAt
boolean isNullAt(int pos) Returns true if the element is null at the given position. -
getBoolean
boolean getBoolean(int pos) Returns the boolean value at the given position. -
getByte
byte getByte(int pos) Returns the byte value at the given position. -
getShort
short getShort(int pos) Returns the short value at the given position. -
getInt
int getInt(int pos) Returns the integer value at the given position. -
getLong
long getLong(int pos) Returns the long value at the given position. -
getFloat
float getFloat(int pos) Returns the float value at the given position. -
getDouble
double getDouble(int pos) Returns the double value at the given position. -
getString
Returns the string value at the given position. -
getDecimal
Returns the decimal value at the given position.The precision and scale are required to determine whether the decimal value was stored in a compact representation (see
DecimalData). -
getTimestamp
Returns the timestamp value at the given position.The precision is required to determine whether the timestamp value was stored in a compact representation (see
TimestampData). -
getRawValue
Returns the raw value at the given position. -
getBinary
byte[] getBinary(int pos) Returns the binary value at the given position. -
getArray
Returns the array value at the given position. -
getMap
Returns the map value at the given position. -
getRow
Returns the row value at the given position.The number of fields is required to correctly extract the row.
-
toBooleanArray
boolean[] toBooleanArray() -
toByteArray
byte[] toByteArray() -
toShortArray
short[] toShortArray() -
toIntArray
int[] toIntArray() -
toLongArray
long[] toLongArray() -
toFloatArray
float[] toFloatArray() -
toDoubleArray
double[] toDoubleArray() -
createElementGetter
Creates an accessor for getting elements in an internal array data structure at the given position.- Parameters:
elementType- the element type of the array
-