abstract class UserDefinedType[UserType >: Null] extends DataType with Serializable
The data type for User Defined Types (UDTs).
This interface allows a user to make their own classes more interoperable with SparkSQL;
e.g., by creating a UserDefinedType for a class X, it becomes possible to create
a DataFrame
which has class X in the schema.
For SparkSQL to recognize UDTs, the UDT must be annotated with SQLUserDefinedType.
The conversion via serialize
occurs when instantiating a DataFrame
from another RDD.
The conversion via deserialize
occurs when reading from a DataFrame
.
- Annotations
- @DeveloperApi() @Since("3.2.0")
- Source
- UserDefinedType.scala
- Alphabetic
- By Inheritance
- UserDefinedType
- Serializable
- DataType
- AbstractDataType
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new UserDefinedType()
Abstract Value Members
- abstract def deserialize(datum: Any): UserType
Convert a SQL datum to the user type
- abstract def serialize(obj: UserType): Any
Convert the user type to a SQL datum
- abstract def sqlType: DataType
Underlying storage type for this UDT
- abstract def userClass: Class[UserType]
Class object for the UserType
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 asInstanceOf[T0]: T0
- Definition Classes
- Any
- def catalogString: String
String representation for the type saved in external catalogs.
String representation for the type saved in external catalogs.
- Definition Classes
- UserDefinedType → DataType
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def defaultSize: Int
The default size of a value of this data type, used internally for size estimation.
The default size of a value of this data type, used internally for size estimation.
- Definition Classes
- UserDefinedType → DataType
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(other: Any): Boolean
- Definition Classes
- UserDefinedType → AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- UserDefinedType → AnyRef → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def json: String
The compact JSON representation of this data type.
The compact JSON representation of this data type.
- Definition Classes
- DataType
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def prettyJson: String
The pretty (i.e.
The pretty (i.e. indented) JSON representation of this data type.
- Definition Classes
- DataType
- def pyUDT: String
Paired Python UDT class, if exists.
- def serializedPyClass: String
Serialized Python UDT class, if exists.
- def simpleString: String
Readable string representation for the type.
Readable string representation for the type.
- Definition Classes
- DataType → AbstractDataType
- def sql: String
- Definition Classes
- UserDefinedType → DataType
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def typeName: String
Name of the type used in JSON serialization.
Name of the type used in JSON serialization.
- Definition Classes
- DataType
- 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()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)