public class BytesColumnVector extends ColumnVector
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.
ColumnVector.Type
Modifier and Type | Field and Description |
---|---|
int[] |
length |
int[] |
start |
byte[][] |
vector |
isNull, isRepeating, noNulls, type
Constructor and Description |
---|
BytesColumnVector()
Use this constructor for normal operation.
|
BytesColumnVector(int size)
Don't call this constructor except for testing purposes.
|
Modifier and Type | Method and Description |
---|---|
int |
bufferSize() |
void |
copySelected(boolean selectedInUse,
int[] sel,
int size,
ColumnVector outputColVector)
Copy the current object contents into the output.
|
void |
ensureSize(int size,
boolean preserveData)
Ensure the ColumnVector can hold at least size values.
|
void |
ensureValPreallocated(int length)
Ensures that we have space allocated for the next value, which has size
length bytes.
|
void |
fill(byte[] value) |
void |
fillWithNulls() |
void |
flatten(boolean selectedInUse,
int[] sel,
int size)
Simplify vector by brute-force flattening noNulls and isRepeating
This can be used to reduce combinatorial explosion of code paths in VectorExpressions
with many arguments, at the expense of loss of some performance.
|
byte[] |
getValPreallocatedBytes() |
int |
getValPreallocatedStart() |
void |
init()
Initialize the column vector.
|
void |
initBuffer()
Initialize buffer to default size.
|
void |
initBuffer(int estimatedValueSize)
You must call initBuffer first before using setVal().
|
void |
reset()
Additional reset work for BytesColumnVector (releasing scratch bytes for by value strings).
|
void |
setConcat(int elementNum,
byte[] leftSourceBuf,
int leftStart,
int leftLen,
byte[] rightSourceBuf,
int rightStart,
int rightLen)
Set a field to the concatenation of two string values.
|
void |
setElement(int outputElementNum,
int inputElementNum,
ColumnVector inputColVector)
Set the element in this column vector from the given input vector.
|
void |
setRef(int elementNum,
byte[] sourceBuf,
int start,
int length)
Set a field by reference.
|
void |
setVal(int elementNum,
byte[] sourceBuf)
Set a field by actually copying in to a local buffer.
|
void |
setVal(int elementNum,
byte[] sourceBuf,
int start,
int length)
Set a field by actually copying in to a local buffer.
|
void |
setValPreallocated(int elementNum,
int length)
Set the length of the preallocated values bytes used.
|
void |
shallowCopyTo(ColumnVector otherCv)
Shallow copy of the contents of this vector to the other vector;
replaces other vector's values.
|
void |
stringifyValue(StringBuilder buffer,
int row)
Print the value for this column into the given string builder.
|
String |
toString(int row) |
decRef, flattenNoNulls, flattenPush, flattenRepeatingNulls, getRef, incRef, setRepeating, unFlatten
public BytesColumnVector()
public BytesColumnVector(int size)
size
- number of elements in the column vectorpublic void reset()
reset
in class ColumnVector
public void setRef(int elementNum, byte[] sourceBuf, int start, int length)
elementNum
- index within column vector to setsourceBuf
- container of source datastart
- start byte position within sourcelength
- length of source byte sequencepublic void initBuffer(int estimatedValueSize)
estimatedValueSize
- Estimated size of buffer space needed per rowpublic void initBuffer()
public int bufferSize()
public void setVal(int elementNum, byte[] sourceBuf, int start, int length)
elementNum
- index within column vector to setsourceBuf
- container of source datastart
- start byte position within sourcelength
- length of source byte sequencepublic void setVal(int elementNum, byte[] sourceBuf)
elementNum
- index within column vector to setsourceBuf
- container of source datapublic void ensureValPreallocated(int length)
public byte[] getValPreallocatedBytes()
public int getValPreallocatedStart()
public void setValPreallocated(int elementNum, int length)
elementNum
- length
- public void setConcat(int elementNum, byte[] leftSourceBuf, int leftStart, int leftLen, byte[] rightSourceBuf, int rightStart, int rightLen)
elementNum
- index within column vector to setleftSourceBuf
- container of left argumentleftStart
- start of left argumentleftLen
- length of left argumentrightSourceBuf
- container of right argumentrightStart
- start of right argumentrightLen
- length of right arugmentpublic void copySelected(boolean selectedInUse, int[] sel, int size, ColumnVector outputColVector)
copySelected
in class ColumnVector
public void flatten(boolean selectedInUse, int[] sel, int size)
flatten
in class ColumnVector
public void fill(byte[] value)
public void fillWithNulls()
public void setElement(int outputElementNum, int inputElementNum, ColumnVector inputColVector)
setElement
in class ColumnVector
public void init()
ColumnVector
init
in class ColumnVector
public String toString(int row)
public void stringifyValue(StringBuilder buffer, int row)
ColumnVector
stringifyValue
in class ColumnVector
buffer
- the buffer to print intorow
- the id of the row to printpublic void ensureSize(int size, boolean preserveData)
ColumnVector
ensureSize
in class ColumnVector
size
- the new minimum sizepreserveData
- should the old data be preserved?public void shallowCopyTo(ColumnVector otherCv)
ColumnVector
shallowCopyTo
in class ColumnVector
Copyright © 2021 The Apache Software Foundation. All rights reserved.