final class UnsafeRow extends InternalRow with Externalizable with KryoSerializable
An Unsafe implementation of Row which is backed by raw memory instead of Java objects.
Each tuple has three parts: [null bit set] [values] [variable length portion]
The bit set is used for null tracking and is aligned to 8-byte word boundaries. It stores one bit per field.
In the values
region, we store one 8-byte word per field. For fields that hold fixed-length
primitive types, such as long, double, or int, we store the value directly in the word. For
fields with non-primitive or variable-length values, we store a relative offset (w.r.t. the
base address of the row) that points to the beginning of the variable-length field, and length
(they are combined into a long).
Instances of UnsafeRow
act as pointers to row data stored in this format.
- Alphabetic
- By Inheritance
- UnsafeRow
- KryoSerializable
- Externalizable
- InternalRow
- Serializable
- Serializable
- SpecializedGetters
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
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
-
def
anyNull(): Boolean
Returns true if there are any NULL values in this row.
Returns true if there are any NULL values in this row.
- Definition Classes
- UnsafeRow → InternalRow
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
copy(): UnsafeRow
Copies this row, returning a self-contained UnsafeRow that stores its data in an internal byte array rather than referencing data stored in a data page.
Copies this row, returning a self-contained UnsafeRow that stores its data in an internal byte array rather than referencing data stored in a data page.
- Definition Classes
- UnsafeRow → InternalRow
-
def
copyFrom(row: UnsafeRow): Unit
Copies the input UnsafeRow to this UnsafeRow, and resize the underlying byte[] when the input row is larger than this row.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(other: Any): Boolean
- Definition Classes
- UnsafeRow → AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
get(ordinal: Int, dataType: DataType): AnyRef
- Definition Classes
- UnsafeRow → SpecializedGetters
-
def
getArray(ordinal: Int): UnsafeArrayData
- Definition Classes
- UnsafeRow → SpecializedGetters
- def getBaseObject(): AnyRef
- def getBaseOffset(): Long
-
def
getBinary(ordinal: Int): Array[Byte]
- Definition Classes
- UnsafeRow → SpecializedGetters
-
def
getBoolean(ordinal: Int): Boolean
- Definition Classes
- UnsafeRow → SpecializedGetters
-
def
getByte(ordinal: Int): Byte
- Definition Classes
- UnsafeRow → SpecializedGetters
-
def
getBytes(): Array[Byte]
Returns the underlying bytes for this UnsafeRow.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getDecimal(ordinal: Int, precision: Int, scale: Int): Decimal
- Definition Classes
- UnsafeRow → SpecializedGetters
-
def
getDouble(ordinal: Int): Double
- Definition Classes
- UnsafeRow → SpecializedGetters
-
def
getFloat(ordinal: Int): Float
- Definition Classes
- UnsafeRow → SpecializedGetters
-
def
getInt(ordinal: Int): Int
- Definition Classes
- UnsafeRow → SpecializedGetters
-
def
getInterval(ordinal: Int): CalendarInterval
- Definition Classes
- UnsafeRow → SpecializedGetters
-
def
getLong(ordinal: Int): Long
- Definition Classes
- UnsafeRow → SpecializedGetters
-
def
getMap(ordinal: Int): UnsafeMapData
- Definition Classes
- UnsafeRow → SpecializedGetters
-
def
getShort(ordinal: Int): Short
- Definition Classes
- UnsafeRow → SpecializedGetters
- def getSizeInBytes(): Int
-
def
getString(ordinal: Int): String
- Definition Classes
- InternalRow
-
def
getStruct(ordinal: Int, numFields: Int): UnsafeRow
- Definition Classes
- UnsafeRow → SpecializedGetters
-
def
getUTF8String(ordinal: Int): UTF8String
- Definition Classes
- UnsafeRow → SpecializedGetters
-
def
hashCode(): Int
- Definition Classes
- UnsafeRow → AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isNullAt(ordinal: Int): Boolean
- Definition Classes
- UnsafeRow → SpecializedGetters
-
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
numFields(): Int
- Definition Classes
- UnsafeRow → InternalRow
-
def
pointTo(buf: Array[Byte], sizeInBytes: Int): Unit
Update this UnsafeRow to point to the underlying byte array.
Update this UnsafeRow to point to the underlying byte array.
- buf
byte array to point to
- sizeInBytes
the number of bytes valid in the byte array
-
def
pointTo(baseObject: Any, baseOffset: Long, sizeInBytes: Int): Unit
Update this UnsafeRow to point to different backing data.
Update this UnsafeRow to point to different backing data.
- baseObject
the base object
- baseOffset
the offset within the base object
- sizeInBytes
the size of this row's backing data, in bytes
-
def
read(kryo: Kryo, in: Input): Unit
- Definition Classes
- UnsafeRow → KryoSerializable
-
def
readExternal(in: ObjectInput): Unit
- Definition Classes
- UnsafeRow → Externalizable
-
def
setBoolean(ordinal: Int, value: Boolean): Unit
- Definition Classes
- UnsafeRow → InternalRow
-
def
setByte(ordinal: Int, value: Byte): Unit
- Definition Classes
- UnsafeRow → InternalRow
-
def
setDecimal(ordinal: Int, value: Decimal, precision: Int): Unit
Updates the decimal column.
Updates the decimal column.
Note: In order to support update a decimal with precision > 18, CAN NOT call setNullAt() for this column.
- Definition Classes
- UnsafeRow → InternalRow
-
def
setDouble(ordinal: Int, value: Double): Unit
- Definition Classes
- UnsafeRow → InternalRow
-
def
setFloat(ordinal: Int, value: Float): Unit
- Definition Classes
- UnsafeRow → InternalRow
-
def
setInt(ordinal: Int, value: Int): Unit
- Definition Classes
- UnsafeRow → InternalRow
-
def
setInterval(ordinal: Int, value: CalendarInterval): Unit
- Definition Classes
- UnsafeRow → InternalRow
-
def
setLong(ordinal: Int, value: Long): Unit
- Definition Classes
- UnsafeRow → InternalRow
- def setNotNullAt(i: Int): Unit
-
def
setNullAt(i: Int): Unit
- Definition Classes
- UnsafeRow → InternalRow
-
def
setShort(ordinal: Int, value: Short): Unit
- Definition Classes
- UnsafeRow → InternalRow
- def setTotalSize(sizeInBytes: Int): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toSeq(schema: StructType): Seq[Any]
- Definition Classes
- InternalRow
-
def
toSeq(fieldTypes: Seq[DataType]): Seq[Any]
Return a Scala Seq representing the row.
Return a Scala Seq representing the row. Elements are placed in the same order in the Seq.
- Definition Classes
- InternalRow
-
def
toString(): String
- Definition Classes
- UnsafeRow → AnyRef → Any
-
def
update(ordinal: Int, value: Any): Unit
Updates the value at column
i
.Updates the value at column
i
. Note that after updating, the given value will be kept in this row, and the caller side should guarantee that this value won't be changed afterwards.- Definition Classes
- UnsafeRow → InternalRow
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
write(kryo: Kryo, out: Output): Unit
- Definition Classes
- UnsafeRow → KryoSerializable
-
def
writeExternal(out: ObjectOutput): Unit
- Definition Classes
- UnsafeRow → Externalizable
-
def
writeFieldTo(ordinal: Int, buffer: ByteBuffer): Unit
Write the bytes of var-length field into ByteBuffer
Write the bytes of var-length field into ByteBuffer
Note: only work with HeapByteBuffer
- def writeTo(buffer: ByteBuffer): Unit
-
def
writeToMemory(target: Any, targetOffset: Long): Unit
Writes the content of this row into a memory address, identified by an object and an offset.
Writes the content of this row into a memory address, identified by an object and an offset. The target memory address must already been allocated, and have enough space to hold all the bytes in this string.
-
def
writeToStream(out: OutputStream, writeBuffer: Array[Byte]): Unit
Write this UnsafeRow's underlying bytes to the given OutputStream.
Write this UnsafeRow's underlying bytes to the given OutputStream.
- out
the stream to write to.
- writeBuffer
a byte array for buffering chunks of off-heap data while writing to the output stream. If this row is backed by an on-heap byte array, then this buffer will not be used and may be null.