public final class BinaryArray extends BinarySection implements BaseArray
[numElements(int)] + [null bits(4-byte word boundaries)] + [values or offset&length] + [variable length part].
BinaryArray are influenced by Apache Spark UnsafeArrayData.
offset, segments, sizeInBytesHIGHEST_FIRST_BIT, HIGHEST_SECOND_TO_EIGHTH_BIT, MAX_FIX_PART_DATA_SIZE| Constructor and Description |
|---|
BinaryArray() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
anyNull() |
static int |
calculateFixLengthPartSize(org.apache.flink.table.types.logical.LogicalType type)
It store real value when type is primitive.
|
static int |
calculateHeaderInBytes(int numFields) |
BinaryArray |
copy() |
BinaryArray |
copy(BinaryArray reuse) |
static BinaryArray |
fromPrimitiveArray(boolean[] arr) |
static BinaryArray |
fromPrimitiveArray(byte[] arr) |
static BinaryArray |
fromPrimitiveArray(double[] arr) |
static BinaryArray |
fromPrimitiveArray(float[] arr) |
static BinaryArray |
fromPrimitiveArray(int[] arr) |
static BinaryArray |
fromPrimitiveArray(long[] arr) |
static BinaryArray |
fromPrimitiveArray(short[] arr) |
BaseArray |
getArray(int pos)
Get array value, internal format is BaseArray.
|
byte[] |
getBinary(int pos)
Get binary value, internal format is byte[].
|
boolean |
getBoolean(int pos)
Get boolean value.
|
byte |
getByte(int pos)
Get byte value.
|
Decimal |
getDecimal(int pos,
int precision,
int scale)
Get decimal value, internal format is Decimal.
|
double |
getDouble(int pos)
Get double value.
|
float |
getFloat(int pos)
Get float value.
|
<T> BinaryGeneric<T> |
getGeneric(int pos)
Get generic value, internal format is BinaryGeneric.
|
int |
getInt(int pos)
Get int value.
|
long |
getLong(int pos)
Get long value.
|
BaseMap |
getMap(int pos)
Get map value, internal format is BaseMap.
|
BaseRow |
getRow(int pos,
int numFields)
Get row value, internal format is BaseRow.
|
short |
getShort(int pos)
Get short value.
|
BinaryString |
getString(int pos)
Get string value, internal format is BinaryString.
|
int |
hashCode() |
boolean |
isNullAt(int pos)
Because the specific row implementation such as BinaryRow uses the binary format.
|
int |
numElements() |
void |
pointTo(org.apache.flink.core.memory.MemorySegment[] segments,
int offset,
int sizeInBytes) |
void |
setBoolean(int pos,
boolean value)
Set boolean value.
|
void |
setByte(int pos,
byte value)
Set byte value.
|
void |
setDecimal(int pos,
Decimal value,
int precision)
Set the decimal column value.
|
void |
setDouble(int pos,
double value)
Set double value.
|
void |
setFloat(int pos,
float value)
Set float value.
|
void |
setInt(int pos,
int value)
Set int value.
|
void |
setLong(int pos,
long value)
Set long value.
|
void |
setNotNullAt(int pos) |
void |
setNullAt(int pos)
Set null to this field.
|
void |
setNullBoolean(int pos) |
void |
setNullByte(int pos) |
void |
setNullDouble(int pos) |
void |
setNullFloat(int pos) |
void |
setNullInt(int pos) |
void |
setNullLong(int pos) |
void |
setNullShort(int pos) |
void |
setShort(int pos,
short value)
Set short value.
|
boolean[] |
toBooleanArray() |
byte[] |
toByteArray() |
<T> T[] |
toClassArray(org.apache.flink.table.types.logical.LogicalType elementType,
Class<T> elementClass) |
double[] |
toDoubleArray() |
float[] |
toFloatArray() |
int[] |
toIntArray() |
long[] |
toLongArray() |
short[] |
toShortArray() |
equals, getOffset, getSegments, getSizeInBytes, pointToclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetreadBinaryFieldFromSegments, readBinaryStringFieldFromSegmentspublic static int calculateHeaderInBytes(int numFields)
public static int calculateFixLengthPartSize(org.apache.flink.table.types.logical.LogicalType type)
public int numElements()
numElements in interface BaseArraypublic void pointTo(org.apache.flink.core.memory.MemorySegment[] segments,
int offset,
int sizeInBytes)
pointTo in class BinarySectionpublic boolean isNullAt(int pos)
TypeGetterSettersisNullAt in interface BaseArrayisNullAt in interface TypeGetterSetterspublic void setNullAt(int pos)
TypeGetterSetterssetNullAt in interface BaseArraysetNullAt in interface TypeGetterSetterspublic void setNotNullAt(int pos)
setNotNullAt in interface BaseArraypublic long getLong(int pos)
TypeGetterSettersgetLong in interface TypeGetterSetterspublic void setLong(int pos,
long value)
TypeGetterSetterssetLong in interface TypeGetterSetterspublic void setNullLong(int pos)
setNullLong in interface BaseArraypublic int getInt(int pos)
TypeGetterSettersgetInt in interface TypeGetterSetterspublic void setInt(int pos,
int value)
TypeGetterSetterssetInt in interface TypeGetterSetterspublic void setNullInt(int pos)
setNullInt in interface BaseArraypublic BinaryString getString(int pos)
TypeGetterSettersgetString in interface TypeGetterSetterspublic Decimal getDecimal(int pos, int precision, int scale)
TypeGetterSettersgetDecimal in interface TypeGetterSetterspublic <T> BinaryGeneric<T> getGeneric(int pos)
TypeGetterSettersgetGeneric in interface TypeGetterSetterspublic byte[] getBinary(int pos)
TypeGetterSettersgetBinary in interface TypeGetterSetterspublic BaseArray getArray(int pos)
TypeGetterSettersgetArray in interface TypeGetterSetterspublic BaseMap getMap(int pos)
TypeGetterSettersgetMap in interface TypeGetterSetterspublic BaseRow getRow(int pos, int numFields)
TypeGetterSettersgetRow in interface TypeGetterSetterspublic boolean getBoolean(int pos)
TypeGetterSettersgetBoolean in interface TypeGetterSetterspublic void setBoolean(int pos,
boolean value)
TypeGetterSetterssetBoolean in interface TypeGetterSetterspublic void setNullBoolean(int pos)
setNullBoolean in interface BaseArraypublic byte getByte(int pos)
TypeGetterSettersgetByte in interface TypeGetterSetterspublic void setByte(int pos,
byte value)
TypeGetterSetterssetByte in interface TypeGetterSetterspublic void setNullByte(int pos)
setNullByte in interface BaseArraypublic short getShort(int pos)
TypeGetterSettersgetShort in interface TypeGetterSetterspublic void setShort(int pos,
short value)
TypeGetterSetterssetShort in interface TypeGetterSetterspublic void setNullShort(int pos)
setNullShort in interface BaseArraypublic float getFloat(int pos)
TypeGetterSettersgetFloat in interface TypeGetterSetterspublic void setFloat(int pos,
float value)
TypeGetterSetterssetFloat in interface TypeGetterSetterspublic void setNullFloat(int pos)
setNullFloat in interface BaseArraypublic double getDouble(int pos)
TypeGetterSettersgetDouble in interface TypeGetterSetterspublic void setDouble(int pos,
double value)
TypeGetterSetterssetDouble in interface TypeGetterSetterspublic void setNullDouble(int pos)
setNullDouble in interface BaseArraypublic void setDecimal(int pos,
Decimal value,
int precision)
TypeGetterSettersNote: Precision is compact: can call setNullAt when decimal is null. Precision is not compact: can not call setNullAt when decimal is null, must call setDecimal(i, null, precision) because we need update var-length-part.
setDecimal in interface TypeGetterSetterspublic boolean anyNull()
public boolean[] toBooleanArray()
toBooleanArray in interface BaseArraypublic byte[] toByteArray()
toByteArray in interface BaseArraypublic short[] toShortArray()
toShortArray in interface BaseArraypublic int[] toIntArray()
toIntArray in interface BaseArraypublic long[] toLongArray()
toLongArray in interface BaseArraypublic float[] toFloatArray()
toFloatArray in interface BaseArraypublic double[] toDoubleArray()
toDoubleArray in interface BaseArraypublic <T> T[] toClassArray(org.apache.flink.table.types.logical.LogicalType elementType,
Class<T> elementClass)
public BinaryArray copy()
public BinaryArray copy(BinaryArray reuse)
public int hashCode()
hashCode in class BinarySectionpublic static BinaryArray fromPrimitiveArray(boolean[] arr)
public static BinaryArray fromPrimitiveArray(byte[] arr)
public static BinaryArray fromPrimitiveArray(short[] arr)
public static BinaryArray fromPrimitiveArray(int[] arr)
public static BinaryArray fromPrimitiveArray(long[] arr)
public static BinaryArray fromPrimitiveArray(float[] arr)
public static BinaryArray fromPrimitiveArray(double[] arr)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.