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
@Internal public class HeapBytesVector extends AbstractHeapVector implements WritableBytesVector
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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.table.data.columnar.vector.BytesColumnVector
BytesColumnVector.Bytes
-
-
Field Summary
Fields Modifier and Type Field Description byte[]
buffer
buffer to use when actually copying in data.int[]
length
The length of each field.int[]
start
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, UNSAFE
-
Fields inherited from class org.apache.flink.table.data.columnar.vector.writable.AbstractWritableVector
dictionary, noNulls
-
-
Constructor Summary
Constructors Constructor Description HeapBytesVector(int size)
Don't call this constructor except for testing purposes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendBytes(int elementNum, byte[] sourceBuf, int start, int length)
Append byte[] at rowId with the provided value.void
fill(byte[] value)
Fill the column vector with the provided value.BytesColumnVector.Bytes
getBytes(int i)
void
reset()
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, setNulls
-
Methods inherited from class org.apache.flink.table.data.columnar.vector.writable.AbstractWritableVector
hasDictionary, setDictionary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.table.data.columnar.vector.ColumnVector
isNullAt
-
Methods inherited from interface org.apache.flink.table.data.columnar.vector.writable.WritableColumnVector
fillWithNulls, getDictionaryIds, hasDictionary, reserveDictionaryIds, setDictionary, setNullAt, setNulls
-
-
-
-
Method Detail
-
reset
public void reset()
Description copied from class:AbstractHeapVector
Resets the column to default state. - fills the isNull array with false. - sets noNulls to true.- Specified by:
reset
in interfaceWritableColumnVector
- Overrides:
reset
in classAbstractHeapVector
-
appendBytes
public void appendBytes(int elementNum, byte[] sourceBuf, int start, int length)
Description copied from interface:WritableBytesVector
Append byte[] at rowId with the provided value. Note: Must append values according to the order of rowId, can not random append.- Specified by:
appendBytes
in interfaceWritableBytesVector
-
fill
public void fill(byte[] value)
Description copied from interface:WritableBytesVector
Fill the column vector with the provided value.- Specified by:
fill
in interfaceWritableBytesVector
-
getBytes
public BytesColumnVector.Bytes getBytes(int i)
- Specified by:
getBytes
in interfaceBytesColumnVector
-
-