Class HeapBytesVector
java.lang.Object
org.apache.flink.table.data.columnar.vector.writable.AbstractWritableVector
org.apache.flink.table.data.columnar.vector.heap.AbstractHeapVector
org.apache.flink.table.data.columnar.vector.heap.HeapBytesVector
- All Implemented Interfaces:
Serializable,BytesColumnVector,ColumnVector,WritableBytesVector,WritableColumnVector
This class supports string and binary data by value reference -- i.e. each field is explicitly
present, as opposed to provided by a dictionary reference. In some cases, all the values will be
in the same byte array to begin with, but this need not be the case. If each value is in a
separate byte array to start with, or not all of the values are in the same original byte array,
you can still assign data by reference into this column vector. This gives flexibility to use
this in multiple situations.
When setting data by reference, the caller is responsible for allocating the byte arrays used to hold the data. You can also set data by value, as long as you call the initBuffer() method first. You can mix "by value" and "by reference" in the same column vector, though that use is probably not typical.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.table.data.columnar.vector.BytesColumnVector
BytesColumnVector.Bytes -
Field Summary
FieldsModifier and TypeFieldDescriptionbyte[]buffer to use when actually copying in data.int[]The length of each field.int[]start offset of each field.Fields inherited from class org.apache.flink.table.data.columnar.vector.heap.AbstractHeapVector
BYTE_ARRAY_OFFSET, dictionaryIds, DOUBLE_ARRAY_OFFSET, FLOAT_ARRAY_OFFSET, INT_ARRAY_OFFSET, isNull, LITTLE_ENDIAN, LONG_ARRAY_OFFSET, UNSAFEFields inherited from class org.apache.flink.table.data.columnar.vector.writable.AbstractWritableVector
dictionary, noNulls -
Constructor Summary
ConstructorsConstructorDescriptionHeapBytesVector(int size) Don't call this constructor except for testing purposes. -
Method Summary
Modifier and TypeMethodDescriptionvoidappendBytes(int elementNum, byte[] sourceBuf, int start, int length) Append byte[] at rowId with the provided value.voidfill(byte[] value) Fill the column vector with the provided value.getBytes(int i) voidreset()Resets the column to default state. - fills the isNull array with false. - sets noNulls to true.Methods inherited from class org.apache.flink.table.data.columnar.vector.heap.AbstractHeapVector
fillWithNulls, getDictionaryIds, getLen, isNullAt, reserveDictionaryIds, setNullAt, setNullsMethods inherited from class org.apache.flink.table.data.columnar.vector.writable.AbstractWritableVector
hasDictionary, setDictionaryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.table.data.columnar.vector.ColumnVector
isNullAtMethods inherited from interface org.apache.flink.table.data.columnar.vector.writable.WritableColumnVector
fillWithNulls, getDictionaryIds, hasDictionary, reserveDictionaryIds, setDictionary, setNullAt, setNulls
-
Field Details
-
start
public int[] startstart offset of each field. -
length
public int[] lengthThe length of each field. -
buffer
public byte[] bufferbuffer to use when actually copying in data.
-
-
Constructor Details
-
HeapBytesVector
public HeapBytesVector(int size) Don't call this constructor except for testing purposes.- Parameters:
size- number of elements in the column vector
-
-
Method Details
-
reset
public void reset()Description copied from class:AbstractHeapVectorResets the column to default state. - fills the isNull array with false. - sets noNulls to true.- Specified by:
resetin interfaceWritableColumnVector- Overrides:
resetin classAbstractHeapVector
-
appendBytes
public void appendBytes(int elementNum, byte[] sourceBuf, int start, int length) Description copied from interface:WritableBytesVectorAppend byte[] at rowId with the provided value. Note: Must append values according to the order of rowId, can not random append.- Specified by:
appendBytesin interfaceWritableBytesVector
-
fill
public void fill(byte[] value) Description copied from interface:WritableBytesVectorFill the column vector with the provided value.- Specified by:
fillin interfaceWritableBytesVector
-
getBytes
- Specified by:
getBytesin interfaceBytesColumnVector
-