|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.hive.ql.exec.vector.ColumnVector org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector
public class BytesColumnVector
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.
Field Summary | |
---|---|
int[] |
length
|
int[] |
start
|
byte[][] |
vector
|
Fields inherited from class org.apache.hadoop.hive.ql.exec.vector.ColumnVector |
---|
isNull, isRepeating, noNulls |
Constructor Summary | |
---|---|
BytesColumnVector()
Use this constructor for normal operation. |
|
BytesColumnVector(int size)
Don't call this constructor except for testing purposes. |
Method Summary | |
---|---|
int |
bufferSize()
|
void |
copySelected(boolean selectedInUse,
int[] sel,
int size,
BytesColumnVector output)
Copy the current object contents into the output. |
void |
fill(byte[] value)
|
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. |
org.apache.hadoop.io.Writable |
getWritableObject(int index)
|
void |
increaseBufferSpace(int nextElemLength)
Increase buffer space enough to accommodate next element. |
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 |
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 outElementNum,
int inputElementNum,
ColumnVector inputVector)
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,
int start,
int length)
Set a field by actually copying in to a local buffer. |
Methods inherited from class org.apache.hadoop.hive.ql.exec.vector.ColumnVector |
---|
flattenNoNulls, flattenRepeatingNulls, reset, unFlatten |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public byte[][] vector
public int[] start
public int[] length
Constructor Detail |
---|
public BytesColumnVector()
public BytesColumnVector(int size)
size
- number of elements in the column vectorMethod Detail |
---|
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 neededpublic 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 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 increaseBufferSpace(int nextElemLength)
nextElemLength
- size of next element to be addedpublic org.apache.hadoop.io.Writable getWritableObject(int index)
getWritableObject
in class ColumnVector
public void copySelected(boolean selectedInUse, int[] sel, int size, BytesColumnVector output)
public void flatten(boolean selectedInUse, int[] sel, int size)
flatten
in class ColumnVector
public void fill(byte[] value)
public void setElement(int outElementNum, int inputElementNum, ColumnVector inputVector)
ColumnVector
setElement
in class ColumnVector
public void init()
ColumnVector
init
in class ColumnVector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |