Package dev.vortex.api
Interface Array
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
JNIArray
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
org.apache.arrow.vector.VectorSchemaRoot
exportToArrow
(org.apache.arrow.memory.BufferAllocator allocator, org.apache.arrow.vector.VectorSchemaRoot reuse) Export to an ArrowVector.getBigDecimal
(int index) Returns the BigDecimal value at the given index.byte[]
getBinary
(int index) Returns the binary value at the given index as a byte array.boolean
getBool
(int index) Returns the boolean value at the given index.byte
getByte
(int index) Returns the byte value at the given index.Returns the data type of this array.double
getDouble
(int index) Returns the double value at the given index.getField
(int index) Returns a child array at the given field index.float
getFloat
(int index) Returns the float value at the given index.int
getInt
(int index) Returns the int value at the given index.long
getLen()
Returns the number of elements in this array.long
getLong
(int index) Returns the long value at the given index.boolean
getNull
(int index) Returns true if the value at the given index is null.int
Returns the total number of null values in this array.short
getShort
(int index) Returns the short value at the given index.getUTF8
(int index) Returns the UTF-8 string value at the given index.void
getUTF8_ptr_len
(int index, long[] ptr, int[] len) Returns the UTF-8 string value at the given index as a pointer and length.long
nbytes()
Returns the total size in bytes of this array including all buffers.slice
(int start, int stop) Returns a slice of this array from start (inclusive) to stop (exclusive).
-
Method Details
-
getLen
long getLen()Returns the number of elements in this array.- Returns:
- the length of the array
-
nbytes
long nbytes()Returns the total size in bytes of this array including all buffers.- Returns:
- the size in bytes
-
exportToArrow
org.apache.arrow.vector.VectorSchemaRoot exportToArrow(org.apache.arrow.memory.BufferAllocator allocator, org.apache.arrow.vector.VectorSchemaRoot reuse) Export to an ArrowVector. The data will now be owned by the VectorSchemaRoot after this operation. -
getDataType
DType getDataType()Returns the data type of this array.- Returns:
- the DType describing the logical type of this array
-
getField
Returns a child array at the given field index.This is used for accessing fields in struct arrays or elements in list arrays.
- Parameters:
index
- the field index- Returns:
- the child array at the specified index
- Throws:
IndexOutOfBoundsException
- if index is out of bounds
-
slice
Returns a slice of this array from start (inclusive) to stop (exclusive).- Parameters:
start
- the starting index (inclusive)stop
- the ending index (exclusive)- Returns:
- a new Array containing the sliced elements
- Throws:
IndexOutOfBoundsException
- if start or stop are out of bounds
-
getNull
boolean getNull(int index) Returns true if the value at the given index is null.- Parameters:
index
- the element index- Returns:
- true if the value is null, false otherwise
- Throws:
IndexOutOfBoundsException
- if index is out of bounds
-
getNullCount
int getNullCount()Returns the total number of null values in this array.- Returns:
- the null count
-
getByte
byte getByte(int index) Returns the byte value at the given index.- Parameters:
index
- the element index- Returns:
- the byte value
- Throws:
IndexOutOfBoundsException
- if index is out of boundsClassCastException
- if the array type is not compatible with byte
-
getShort
short getShort(int index) Returns the short value at the given index.- Parameters:
index
- the element index- Returns:
- the short value
- Throws:
IndexOutOfBoundsException
- if index is out of boundsClassCastException
- if the array type is not compatible with short
-
getInt
int getInt(int index) Returns the int value at the given index.- Parameters:
index
- the element index- Returns:
- the int value
- Throws:
IndexOutOfBoundsException
- if index is out of boundsClassCastException
- if the array type is not compatible with int
-
getLong
long getLong(int index) Returns the long value at the given index.- Parameters:
index
- the element index- Returns:
- the long value
- Throws:
IndexOutOfBoundsException
- if index is out of boundsClassCastException
- if the array type is not compatible with long
-
getBool
boolean getBool(int index) Returns the boolean value at the given index.- Parameters:
index
- the element index- Returns:
- the boolean value
- Throws:
IndexOutOfBoundsException
- if index is out of boundsClassCastException
- if the array type is not compatible with boolean
-
getFloat
float getFloat(int index) Returns the float value at the given index.- Parameters:
index
- the element index- Returns:
- the float value
- Throws:
IndexOutOfBoundsException
- if index is out of boundsClassCastException
- if the array type is not compatible with float
-
getDouble
double getDouble(int index) Returns the double value at the given index.- Parameters:
index
- the element index- Returns:
- the double value
- Throws:
IndexOutOfBoundsException
- if index is out of boundsClassCastException
- if the array type is not compatible with double
-
getBigDecimal
Returns the BigDecimal value at the given index.- Parameters:
index
- the element index- Returns:
- the BigDecimal value
- Throws:
IndexOutOfBoundsException
- if index is out of boundsClassCastException
- if the array type is not compatible with decimal
-
getUTF8
Returns the UTF-8 string value at the given index.- Parameters:
index
- the element index- Returns:
- the string value
- Throws:
IndexOutOfBoundsException
- if index is out of boundsClassCastException
- if the array type is not compatible with string
-
getUTF8_ptr_len
void getUTF8_ptr_len(int index, long[] ptr, int[] len) Returns the UTF-8 string value at the given index as a pointer and length.This is a low-level method that provides direct access to the underlying string data without copying. The pointer and length are written to the provided arrays.
- Parameters:
index
- the element indexptr
- array to store the pointer (first element will be set)len
- array to store the length (first element will be set)- Throws:
IndexOutOfBoundsException
- if index is out of boundsClassCastException
- if the array type is not compatible with string
-
getBinary
byte[] getBinary(int index) Returns the binary value at the given index as a byte array.- Parameters:
index
- the element index- Returns:
- the binary value as a byte array
- Throws:
IndexOutOfBoundsException
- if index is out of boundsClassCastException
- if the array type is not compatible with binary
-
close
void close()- Specified by:
close
in interfaceAutoCloseable
-