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| 构造器和说明 |
|---|
BinaryArray() |
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
SqlTimestamp |
getTimestamp(int pos,
int precision)
Get Timestamp value, internal format is SqlTimestamp.
|
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.
|
void |
setTimestamp(int pos,
SqlTimestamp value,
int precision)
Set Timestamp 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, pointTogetreadBinaryFieldFromSegments, readBinaryStringFieldFromSegmentspublic static int calculateHeaderInBytes(int numFields)
public static int calculateFixLengthPartSize(org.apache.flink.table.types.logical.LogicalType type)
public int numElements()
numElements 在接口中 BaseArraypublic void pointTo(org.apache.flink.core.memory.MemorySegment[] segments,
int offset,
int sizeInBytes)
pointTo 在类中 BinarySectionpublic boolean isNullAt(int pos)
TypeGetterSettersisNullAt 在接口中 BaseArrayisNullAt 在接口中 TypeGetterSetterspublic void setNullAt(int pos)
TypeGetterSetterssetNullAt 在接口中 BaseArraysetNullAt 在接口中 TypeGetterSetterspublic void setNotNullAt(int pos)
setNotNullAt 在接口中 BaseArraypublic long getLong(int pos)
TypeGetterSettersgetLong 在接口中 TypeGetterSetterspublic void setLong(int pos,
long value)
TypeGetterSetterssetLong 在接口中 TypeGetterSetterspublic void setNullLong(int pos)
setNullLong 在接口中 BaseArraypublic int getInt(int pos)
TypeGetterSettersgetInt 在接口中 TypeGetterSetterspublic void setInt(int pos,
int value)
TypeGetterSetterssetInt 在接口中 TypeGetterSetterspublic void setNullInt(int pos)
setNullInt 在接口中 BaseArraypublic BinaryString getString(int pos)
TypeGetterSettersgetString 在接口中 TypeGetterSetterspublic Decimal getDecimal(int pos, int precision, int scale)
TypeGetterSettersgetDecimal 在接口中 TypeGetterSetterspublic SqlTimestamp getTimestamp(int pos, int precision)
TypeGetterSettersgetTimestamp 在接口中 TypeGetterSetterspublic <T> BinaryGeneric<T> getGeneric(int pos)
TypeGetterSettersgetGeneric 在接口中 TypeGetterSetterspublic byte[] getBinary(int pos)
TypeGetterSettersgetBinary 在接口中 TypeGetterSetterspublic BaseArray getArray(int pos)
TypeGetterSettersgetArray 在接口中 TypeGetterSetterspublic BaseMap getMap(int pos)
TypeGetterSettersgetMap 在接口中 TypeGetterSetterspublic BaseRow getRow(int pos, int numFields)
TypeGetterSettersgetRow 在接口中 TypeGetterSetterspublic boolean getBoolean(int pos)
TypeGetterSettersgetBoolean 在接口中 TypeGetterSetterspublic void setBoolean(int pos,
boolean value)
TypeGetterSetterssetBoolean 在接口中 TypeGetterSetterspublic void setNullBoolean(int pos)
setNullBoolean 在接口中 BaseArraypublic byte getByte(int pos)
TypeGetterSettersgetByte 在接口中 TypeGetterSetterspublic void setByte(int pos,
byte value)
TypeGetterSetterssetByte 在接口中 TypeGetterSetterspublic void setNullByte(int pos)
setNullByte 在接口中 BaseArraypublic short getShort(int pos)
TypeGetterSettersgetShort 在接口中 TypeGetterSetterspublic void setShort(int pos,
short value)
TypeGetterSetterssetShort 在接口中 TypeGetterSetterspublic void setNullShort(int pos)
setNullShort 在接口中 BaseArraypublic float getFloat(int pos)
TypeGetterSettersgetFloat 在接口中 TypeGetterSetterspublic void setFloat(int pos,
float value)
TypeGetterSetterssetFloat 在接口中 TypeGetterSetterspublic void setNullFloat(int pos)
setNullFloat 在接口中 BaseArraypublic double getDouble(int pos)
TypeGetterSettersgetDouble 在接口中 TypeGetterSetterspublic void setDouble(int pos,
double value)
TypeGetterSetterssetDouble 在接口中 TypeGetterSetterspublic void setNullDouble(int pos)
setNullDouble 在接口中 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 在接口中 TypeGetterSetterspublic void setTimestamp(int pos,
SqlTimestamp value,
int precision)
TypeGetterSettersNote: If precision is compact: can call setNullAt when SqlTimestamp value is null. Otherwise: can not call setNullAt when SqlTimestamp value is null, must call setTimestamp(ordinal, null, precision) because we need to update var-length-part.
setTimestamp 在接口中 TypeGetterSetterspublic boolean anyNull()
public boolean[] toBooleanArray()
toBooleanArray 在接口中 BaseArraypublic byte[] toByteArray()
toByteArray 在接口中 BaseArraypublic short[] toShortArray()
toShortArray 在接口中 BaseArraypublic int[] toIntArray()
toIntArray 在接口中 BaseArraypublic long[] toLongArray()
toLongArray 在接口中 BaseArraypublic float[] toFloatArray()
toFloatArray 在接口中 BaseArraypublic double[] toDoubleArray()
toDoubleArray 在接口中 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 在类中 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.