public abstract class DataType
extends Object
Modifier and Type | Field and Description |
---|---|
static BinaryType |
BinaryType
Gets the BinaryType object.
|
static BooleanType |
BooleanType
Gets the BooleanType object.
|
static ByteType |
ByteType
Gets the ByteType object.
|
static DateType |
DateType
Gets the DateType object.
|
static DoubleType |
DoubleType
Gets the DoubleType object.
|
static FloatType |
FloatType
Gets the FloatType object.
|
static IntegerType |
IntegerType
Gets the IntegerType object.
|
static LongType |
LongType
Gets the LongType object.
|
static NullType |
NullType
Gets the NullType object.
|
static ShortType |
ShortType
Gets the ShortType object.
|
static StringType |
StringType
Gets the StringType object.
|
static TimestampType |
TimestampType
Gets the TimestampType object.
|
Constructor and Description |
---|
DataType() |
Modifier and Type | Method and Description |
---|---|
static ArrayType |
createArrayType(DataType elementType)
Creates an ArrayType by specifying the data type of elements (
elementType ). |
static ArrayType |
createArrayType(DataType elementType,
boolean containsNull)
Creates an ArrayType by specifying the data type of elements (
elementType ) and
whether the array contains null values (containsNull ). |
static MapType |
createMapType(DataType keyType,
DataType valueType)
Creates a MapType by specifying the data type of keys (
keyType ) and values
(keyType ). |
static MapType |
createMapType(DataType keyType,
DataType valueType,
boolean valueContainsNull)
Creates a MapType by specifying the data type of keys (
keyType ), the data type of
values (keyType ), and whether values contain any null value
(valueContainsNull ). |
static StructField |
createStructField(String name,
DataType dataType,
boolean nullable)
Creates a StructField with empty metadata.
|
static StructField |
createStructField(String name,
DataType dataType,
boolean nullable,
org.apache.spark.sql.api.java.Metadata metadata)
Creates a StructField by specifying the name (
name ), data type (dataType ) and
whether values of this field can be null values (nullable ). |
static StructType |
createStructType(java.util.List<StructField> fields)
Creates a StructType with the given list of StructFields (
fields ). |
static StructType |
createStructType(StructField[] fields)
Creates a StructType with the given StructField array (
fields ). |
public static final StringType StringType
public static final BinaryType BinaryType
public static final BooleanType BooleanType
public static final DateType DateType
public static final TimestampType TimestampType
public static final DoubleType DoubleType
public static final FloatType FloatType
public static final ByteType ByteType
public static final IntegerType IntegerType
public static final LongType LongType
public static final ShortType ShortType
public static final NullType NullType
public static ArrayType createArrayType(DataType elementType)
elementType
).
The field of containsNull
is set to true
.public static ArrayType createArrayType(DataType elementType, boolean containsNull)
elementType
) and
whether the array contains null values (containsNull
).public static MapType createMapType(DataType keyType, DataType valueType)
keyType
) and values
(keyType
). The field of valueContainsNull
is set to true
.public static MapType createMapType(DataType keyType, DataType valueType, boolean valueContainsNull)
keyType
), the data type of
values (keyType
), and whether values contain any null value
(valueContainsNull
).public static StructField createStructField(String name, DataType dataType, boolean nullable, org.apache.spark.sql.api.java.Metadata metadata)
name
), data type (dataType
) and
whether values of this field can be null values (nullable
).public static StructField createStructField(String name, DataType dataType, boolean nullable)
public static StructType createStructType(java.util.List<StructField> fields)
fields
).public static StructType createStructType(StructField[] fields)
fields
).