abstract class WritableColumnVector extends ColumnVector
This class adds write APIs to ColumnVector. It supports all the types and contains put APIs as well as their batched versions. The batched versions are preferable whenever possible.
Capacity: The data stored is dense but the arrays are not fixed capacity. It is the responsibility of the caller to call reserve() to ensure there is enough room before adding elements. This means that the put() APIs do not check as in common cases (i.e. flat schemas), the lengths are known up front.
A WritableColumnVector should be considered immutable once originally created. In other words, it is not valid to call put APIs after reads until reset() is called.
WritableColumnVector are intended to be reused.
- Alphabetic
- By Inheritance
- WritableColumnVector
- ColumnVector
- AutoCloseable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new WritableColumnVector(capacity: Int, type: DataType)
- Attributes
- protected[vectorized]
Abstract Value Members
- abstract def getArrayLength(rowId: Int): Int
- abstract def getArrayOffset(rowId: Int): Int
- abstract def getBoolean(arg0: Int): Boolean
- Definition Classes
- ColumnVector
- abstract def getByte(arg0: Int): Byte
- Definition Classes
- ColumnVector
- abstract def getByteBuffer(rowId: Int, count: Int): ByteBuffer
Gets the values of bytes from [rowId, rowId + count), as a ByteBuffer.
Gets the values of bytes from [rowId, rowId + count), as a ByteBuffer. This method is similar to
int), but avoids making a copy. - abstract def getBytesAsUTF8String(rowId: Int, count: Int): UTF8String
Gets the values of bytes from [rowId, rowId + count), as a UTF8String.
Gets the values of bytes from [rowId, rowId + count), as a UTF8String. This method is similar to
int), but can save data copy as UTF8String is used as a pointer.- Attributes
- protected[vectorized]
- abstract def getDictId(rowId: Int): Int
Returns the dictionary Id for rowId.
Returns the dictionary Id for rowId.
This should only be called when this
WritableColumnVectorrepresents dictionaryIds. We have this separate method for dictionaryIds as per SPARK-16928. - abstract def getDouble(arg0: Int): Double
- Definition Classes
- ColumnVector
- abstract def getFloat(arg0: Int): Float
- Definition Classes
- ColumnVector
- abstract def getInt(arg0: Int): Int
- Definition Classes
- ColumnVector
- abstract def getLong(arg0: Int): Long
- Definition Classes
- ColumnVector
- abstract def getShort(arg0: Int): Short
- Definition Classes
- ColumnVector
- abstract def isNullAt(arg0: Int): Boolean
- Definition Classes
- ColumnVector
- abstract def putArray(rowId: Int, offset: Int, length: Int): Unit
Puts a byte array that already exists in this column.
- abstract def putBoolean(rowId: Int, value: Boolean): Unit
Sets
valueto the value at rowId. - abstract def putBooleans(rowId: Int, src: Byte): Unit
Sets bits from [src[0], src[7]] to [rowId, rowId + 7] src must contain bit-packed 8 booleans in the byte.
- abstract def putBooleans(rowId: Int, count: Int, value: Boolean): Unit
Sets value to [rowId, rowId + count).
- abstract def putByte(rowId: Int, value: Byte): Unit
Sets
valueto the value at rowId. - abstract def putByteArray(rowId: Int, value: Array[Byte], offset: Int, count: Int): Int
Sets values from [value + offset, value + offset + count) to the values at rowId.
- abstract def putBytes(rowId: Int, count: Int, src: Array[Byte], srcIndex: Int): Unit
Sets values from [src[srcIndex], src[srcIndex + count]) to [rowId, rowId + count)
- abstract def putBytes(rowId: Int, count: Int, value: Byte): Unit
Sets value to [rowId, rowId + count).
- abstract def putDouble(rowId: Int, value: Double): Unit
Sets
valueto the value at rowId. - abstract def putDoubles(rowId: Int, count: Int, src: Array[Byte], srcIndex: Int): Unit
Sets values from [src[srcIndex], src[srcIndex + count * 8]) to [rowId, rowId + count) The data in src must be ieee formatted doubles in platform native endian.
- abstract def putDoubles(rowId: Int, count: Int, src: Array[Double], srcIndex: Int): Unit
Sets values from [src[srcIndex], src[srcIndex + count]) to [rowId, rowId + count)
- abstract def putDoubles(rowId: Int, count: Int, value: Double): Unit
Sets value to [rowId, rowId + count).
- abstract def putDoublesLittleEndian(rowId: Int, count: Int, src: Array[Byte], srcIndex: Int): Unit
Sets values from [src[srcIndex], src[srcIndex + count * 8]) to [rowId, rowId + count) The data in src must be ieee formatted doubles in little endian.
- abstract def putFloat(rowId: Int, value: Float): Unit
Sets
valueto the value at rowId. - abstract def putFloats(rowId: Int, count: Int, src: Array[Byte], srcIndex: Int): Unit
Sets values from [src[srcIndex], src[srcIndex + count * 4]) to [rowId, rowId + count) The data in src must be ieee formatted floats in platform native endian.
- abstract def putFloats(rowId: Int, count: Int, src: Array[Float], srcIndex: Int): Unit
Sets values from [src[srcIndex], src[srcIndex + count]) to [rowId, rowId + count)
- abstract def putFloats(rowId: Int, count: Int, value: Float): Unit
Sets value to [rowId, rowId + count).
- abstract def putFloatsLittleEndian(rowId: Int, count: Int, src: Array[Byte], srcIndex: Int): Unit
Sets values from [src[srcIndex], src[srcIndex + count * 4]) to [rowId, rowId + count) The data in src must be ieee formatted floats in little endian.
- abstract def putInt(rowId: Int, value: Int): Unit
Sets
valueto the value at rowId. - abstract def putInts(rowId: Int, count: Int, src: Array[Byte], srcIndex: Int): Unit
Sets values from [src[srcIndex], src[srcIndex + count * 4]) to [rowId, rowId + count) The data in src must be 4-byte platform native endian ints.
- abstract def putInts(rowId: Int, count: Int, src: Array[Int], srcIndex: Int): Unit
Sets values from [src[srcIndex], src[srcIndex + count]) to [rowId, rowId + count)
- abstract def putInts(rowId: Int, count: Int, value: Int): Unit
Sets value to [rowId, rowId + count).
- abstract def putIntsLittleEndian(rowId: Int, count: Int, src: Array[Byte], srcIndex: Int): Unit
Sets values from [src[srcIndex], src[srcIndex + count * 4]) to [rowId, rowId + count) The data in src must be 4-byte little endian ints.
- abstract def putLong(rowId: Int, value: Long): Unit
Sets
valueto the value at rowId. - abstract def putLongs(rowId: Int, count: Int, src: Array[Byte], srcIndex: Int): Unit
Sets values from [src[srcIndex], src[srcIndex + count * 8]) to [rowId, rowId + count) The data in src must be 8-byte platform native endian longs.
- abstract def putLongs(rowId: Int, count: Int, src: Array[Long], srcIndex: Int): Unit
Sets values from [src[srcIndex], src[srcIndex + count]) to [rowId, rowId + count)
- abstract def putLongs(rowId: Int, count: Int, value: Long): Unit
Sets value to [rowId, rowId + count).
- abstract def putLongsLittleEndian(rowId: Int, count: Int, src: Array[Byte], srcIndex: Int): Unit
Sets values from [src + srcIndex, src + srcIndex + count * 8) to [rowId, rowId + count) The data in src must be 8-byte little endian longs.
- abstract def putNotNull(rowId: Int): Unit
Sets null/not null to the value at rowId.
- abstract def putNotNulls(rowId: Int, count: Int): Unit
- abstract def putNull(rowId: Int): Unit
- abstract def putNulls(rowId: Int, count: Int): Unit
Sets null/not null to the values at [rowId, rowId + count).
- abstract def putShort(rowId: Int, value: Short): Unit
Sets
valueto the value at rowId. - abstract def putShorts(rowId: Int, count: Int, src: Array[Byte], srcIndex: Int): Unit
Sets values from [src[srcIndex], src[srcIndex + count * 2]) to [rowId, rowId + count) The data in src must be 2-byte platform native endian shorts.
- abstract def putShorts(rowId: Int, count: Int, src: Array[Short], srcIndex: Int): Unit
Sets values from [src[srcIndex], src[srcIndex + count]) to [rowId, rowId + count)
- abstract def putShorts(rowId: Int, count: Int, value: Short): Unit
Sets value to [rowId, rowId + count).
- abstract def reserveInternal(capacity: Int): Unit
Ensures that there is enough storage to store capacity elements.
Ensures that there is enough storage to store capacity elements. That is, the put() APIs must work for all rowIds < capacity.
- Attributes
- protected[vectorized]
- abstract def reserveNewColumn(capacity: Int, type: DataType): WritableColumnVector
Reserve a new column.
Reserve a new column.
- Attributes
- protected[vectorized]
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def addElementsAppended(num: Int): Unit
Increment number of elements appended by 'num'.
Increment number of elements appended by 'num'.
This is useful when one wants to use the 'putXXX' API to add new elements to the vector, but still want to keep count of how many elements have been added (since the 'putXXX' APIs don't increment count).
- final def appendArray(length: Int): Int
- final def appendBoolean(v: Boolean): Int
- final def appendBooleans(count: Int, src: Byte, offset: Int): Int
Append bits from [src[offset], src[offset + count]) src must contain bit-packed 8 booleans in the byte.
- final def appendBooleans(count: Int, v: Boolean): Int
- final def appendByte(v: Byte): Int
- final def appendByteArray(value: Array[Byte], offset: Int, length: Int): Int
- final def appendBytes(length: Int, src: Array[Byte], offset: Int): Int
- final def appendBytes(count: Int, v: Byte): Int
- final def appendDouble(v: Double): Int
- final def appendDoubles(length: Int, src: Array[Double], offset: Int): Int
- final def appendDoubles(count: Int, v: Double): Int
- final def appendFloat(v: Float): Int
- final def appendFloats(length: Int, src: Array[Float], offset: Int): Int
- final def appendFloats(count: Int, v: Float): Int
- final def appendInt(v: Int): Int
- final def appendInts(length: Int, src: Array[Int], offset: Int): Int
- final def appendInts(count: Int, v: Int): Int
- final def appendLong(v: Long): Int
- final def appendLongs(length: Int, src: Array[Long], offset: Int): Int
- final def appendLongs(count: Int, v: Long): Int
- final def appendNotNull(): Int
- final def appendNotNulls(count: Int): Int
- final def appendNull(): Int
Append APIs.
Append APIs. These APIs all behave similarly and will append data to the current vector. It is not valid to mix the put and append APIs. The append APIs are slower and should only be used if the sizes are not known up front. In all these cases, the return value is the rowId for the first appended element.
- final def appendNulls(count: Int): Int
- final def appendShort(v: Short): Int
- final def appendShorts(length: Int, src: Array[Short], offset: Int): Int
- final def appendShorts(count: Int, v: Short): Int
- final def appendStruct(isNull: Boolean): Int
Appends a NULL struct.
Appends a NULL struct. This *has* to be used for structs instead of appendNull() as this recursively appends a NULL to its children. We don't have this logic as the general appendNull implementation to optimize the more common non-struct case.
- def arrayData(): WritableColumnVector
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def close(): Unit
- Definition Classes
- WritableColumnVector → ColumnVector → AutoCloseable
- Annotations
- @Override()
- final def dataType(): DataType
- Definition Classes
- ColumnVector
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getArray(rowId: Int): ColumnarArray
- Definition Classes
- WritableColumnVector → ColumnVector
- Annotations
- @Override()
- def getBinary(rowId: Int): Array[Byte]
- Definition Classes
- WritableColumnVector → ColumnVector
- Annotations
- @Override()
- def getBooleans(arg0: Int, arg1: Int): Array[Boolean]
- Definition Classes
- ColumnVector
- def getBytes(arg0: Int, arg1: Int): Array[Byte]
- Definition Classes
- ColumnVector
- def getChild(ordinal: Int): WritableColumnVector
- Definition Classes
- WritableColumnVector → ColumnVector
- Annotations
- @Override()
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getDecimal(rowId: Int, precision: Int, scale: Int): Decimal
- Definition Classes
- WritableColumnVector → ColumnVector
- Annotations
- @Override()
- def getDictionaryIds(): WritableColumnVector
Returns the underlying integer column for ids of dictionary.
- def getDoubles(arg0: Int, arg1: Int): Array[Double]
- Definition Classes
- ColumnVector
- final def getElementsAppended(): Int
Returns the elements appended.
Returns the elements appended. This is useful
- def getFloats(arg0: Int, arg1: Int): Array[Float]
- Definition Classes
- ColumnVector
- final def getInterval(arg0: Int): CalendarInterval
- Definition Classes
- ColumnVector
- def getInts(arg0: Int, arg1: Int): Array[Int]
- Definition Classes
- ColumnVector
- def getLongs(arg0: Int, arg1: Int): Array[Long]
- Definition Classes
- ColumnVector
- final def getMap(rowId: Int): ColumnarMap
- Definition Classes
- WritableColumnVector → ColumnVector
- Annotations
- @Override()
- def getNumChildren(): Int
Returns the number of child vectors.
- def getShorts(arg0: Int, arg1: Int): Array[Short]
- Definition Classes
- ColumnVector
- final def getStruct(arg0: Int): ColumnarRow
- Definition Classes
- ColumnVector
- def getUTF8String(rowId: Int): UTF8String
- Definition Classes
- WritableColumnVector → ColumnVector
- Annotations
- @Override()
- def hasDictionary(): Boolean
Returns true if this column has a dictionary.
- def hasNull(): Boolean
- Definition Classes
- WritableColumnVector → ColumnVector
- Annotations
- @Override()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isAllNull(): Boolean
Whether this column only contains null values.
- def isArray(): Boolean
- Attributes
- protected[vectorized]
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def numNulls(): Int
- Definition Classes
- WritableColumnVector → ColumnVector
- Annotations
- @Override()
- def putBooleans(rowId: Int, count: Int, src: Byte, srcIndex: Int): Unit
Sets bits from [src[srcIndex], src[srcIndex + count]) to [rowId, rowId + count) src must contain bit-packed 8 booleans in the byte.
- final def putByteArray(rowId: Int, value: Array[Byte]): Int
- def putDecimal(rowId: Int, value: Decimal, precision: Int): Unit
- def putInterval(rowId: Int, value: CalendarInterval): Unit
- def reserve(requiredCapacity: Int): Unit
- def reserveAdditional(additionalCapacity: Int): Unit
- def reserveDictionaryIds(capacity: Int): WritableColumnVector
Reserve a integer column for ids of dictionary.
- def reset(): Unit
Resets this column for writing.
Resets this column for writing. The currently stored values are no longer accessible.
- final def setAllNull(): Unit
Marks this column only contains null values.
- def setDictionary(dictionary: Dictionary): Unit
Update the dictionary.
- final def setIsConstant(): Unit
Marks this column as being constant.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()