Package org.apache.spark.sql.types
Class UDTRegistration
Object
org.apache.spark.sql.types.UDTRegistration
This object keeps the mappings between user classes and their User Defined Types (UDTs).
Previously we use the annotation
SQLUserDefinedType
to register UDTs for user classes.
However, by doing this, we add SparkSQL dependency on user classes. This object provides
alternative approach to register UDTs for user classes.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Queries if a given user class is already registered or not.static scala.Option<Class<?>>
Returns the Class of UserDefinedType for the name of a given user class.static org.slf4j.Logger
static void
org$apache$spark$internal$Logging$$log__$eq
(org.slf4j.Logger x$1) static void
Registers an UserDefinedType to an user class.
-
Constructor Details
-
UDTRegistration
public UDTRegistration()
-
-
Method Details
-
exists
Queries if a given user class is already registered or not.- Parameters:
userClassName
- the name of user class- Returns:
- boolean value indicates if the given user class is registered or not
-
register
Registers an UserDefinedType to an user class. If the user class is already registered with another UserDefinedType, warning log message will be shown.- Parameters:
userClass
- the name of user classudtClass
- the name of UserDefinedType class for the given userClass
-
getUDTFor
Returns the Class of UserDefinedType for the name of a given user class.- Parameters:
userClass
- class name of user class- Returns:
- Option value of the Class object of UserDefinedType
-
org$apache$spark$internal$Logging$$log_
public static org.slf4j.Logger org$apache$spark$internal$Logging$$log_() -
org$apache$spark$internal$Logging$$log__$eq
public static void org$apache$spark$internal$Logging$$log__$eq(org.slf4j.Logger x$1)
-