public abstract class ColumnType<T extends org.apache.spark.sql.types.DataType,JvmType>
extends Object
ByteBuffer of a column.
| Constructor and Description |
|---|
ColumnType(int typeId,
int defaultSize) |
| Modifier and Type | Method and Description |
|---|---|
int |
actualSize(org.apache.spark.sql.Row row,
int ordinal)
Returns the size of the value
row(ordinal). |
abstract void |
append(JvmType v,
java.nio.ByteBuffer buffer)
Appends the given value v of type T into the given ByteBuffer.
|
void |
append(org.apache.spark.sql.Row row,
int ordinal,
java.nio.ByteBuffer buffer)
Appends
row(ordinal) of type T into the given ByteBuffer. |
static ColumnType<?,?> |
apply(org.apache.spark.sql.types.DataType dataType) |
JvmType |
clone(JvmType v)
Creates a duplicated copy of the value.
|
void |
copyField(org.apache.spark.sql.Row from,
int fromOrdinal,
org.apache.spark.sql.catalyst.expressions.MutableRow to,
int toOrdinal)
Copies
from(fromOrdinal) to to(toOrdinal). |
int |
defaultSize() |
abstract JvmType |
extract(java.nio.ByteBuffer buffer)
Extracts a value out of the buffer at the buffer's current position.
|
void |
extract(java.nio.ByteBuffer buffer,
org.apache.spark.sql.catalyst.expressions.MutableRow row,
int ordinal)
Extracts a value out of the buffer at the buffer's current position and stores in
row(ordinal). |
abstract JvmType |
getField(org.apache.spark.sql.Row row,
int ordinal)
Returns
row(ordinal). |
abstract void |
setField(org.apache.spark.sql.catalyst.expressions.MutableRow row,
int ordinal,
JvmType value)
Sets
row(ordinal) to field. |
String |
toString() |
int |
typeId() |
public static ColumnType<?,?> apply(org.apache.spark.sql.types.DataType dataType)
public int typeId()
public int defaultSize()
public abstract JvmType extract(java.nio.ByteBuffer buffer)
public void extract(java.nio.ByteBuffer buffer,
org.apache.spark.sql.catalyst.expressions.MutableRow row,
int ordinal)
row(ordinal). Subclasses should override this method to avoid boxing/unboxing costs whenever
possible.public abstract void append(JvmType v, java.nio.ByteBuffer buffer)
public void append(org.apache.spark.sql.Row row,
int ordinal,
java.nio.ByteBuffer buffer)
row(ordinal) of type T into the given ByteBuffer. Subclasses should override this
method to avoid boxing/unboxing costs whenever possible.public int actualSize(org.apache.spark.sql.Row row,
int ordinal)
row(ordinal). This is used to calculate the size of variable
length types such as byte arrays and strings.public abstract JvmType getField(org.apache.spark.sql.Row row, int ordinal)
row(ordinal). Subclasses should override this method to avoid boxing/unboxing costs
whenever possible.public abstract void setField(org.apache.spark.sql.catalyst.expressions.MutableRow row,
int ordinal,
JvmType value)
row(ordinal) to field. Subclasses should override this method to avoid boxing/unboxing
costs whenever possible.public void copyField(org.apache.spark.sql.Row from,
int fromOrdinal,
org.apache.spark.sql.catalyst.expressions.MutableRow to,
int toOrdinal)
from(fromOrdinal) to to(toOrdinal). Subclasses should override this method to avoid
boxing/unboxing costs whenever possible.public String toString()
toString in class Object