public class VectorUDT extends UserDefinedType<Vector>
User-defined type for Vector
which allows easy interaction with SQL
via DataFrame
.
Constructor and Description |
---|
VectorUDT() |
Modifier and Type | Method and Description |
---|---|
Vector |
deserialize(Object datum)
Convert a SQL datum to the user type
|
boolean |
equals(Object o) |
int |
hashCode() |
String |
pyUDT()
Paired Python UDT class, if exists.
|
org.apache.spark.sql.catalyst.InternalRow |
serialize(Object obj)
Convert the user type to a SQL datum
|
StructType |
sqlType()
Underlying storage type for this UDT
|
String |
typeName()
Name of the type used in JSON serialization.
|
Class<Vector> |
userClass()
Class object for the UserType
|
defaultSize, serializedPyClass
fromCaseClassString, fromJson, json, prettyJson, simpleString
public StructType sqlType()
UserDefinedType
sqlType
in class UserDefinedType<Vector>
public org.apache.spark.sql.catalyst.InternalRow serialize(Object obj)
UserDefinedType
TODO: Can we make this take obj: UserType? The issue is in CatalystTypeConverters.convertToCatalyst, where we need to convert Any to UserType.
serialize
in class UserDefinedType<Vector>
obj
- (undocumented)public Vector deserialize(Object datum)
UserDefinedType
deserialize
in class UserDefinedType<Vector>
public String pyUDT()
UserDefinedType
pyUDT
in class UserDefinedType<Vector>
public Class<Vector> userClass()
UserDefinedType
userClass
in class UserDefinedType<Vector>
public boolean equals(Object o)
equals
in class UserDefinedType<Vector>
public int hashCode()
hashCode
in class Object