|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.apache.spark.sql.types.DataTypes
public class DataTypes
To get/create specific data type, users should use singleton objects and factory methods provided by this class.
Field Summary | |
---|---|
static DataType |
BinaryType
Gets the BinaryType object. |
static DataType |
BooleanType
Gets the BooleanType object. |
static DataType |
ByteType
Gets the ByteType object. |
static DataType |
DateType
Gets the DateType object. |
static DataType |
DoubleType
Gets the DoubleType object. |
static DataType |
FloatType
Gets the FloatType object. |
static DataType |
IntegerType
Gets the IntegerType object. |
static DataType |
LongType
Gets the LongType object. |
static DataType |
NullType
Gets the NullType object. |
static DataType |
ShortType
Gets the ShortType object. |
static DataType |
StringType
Gets the StringType object. |
static DataType |
TimestampType
Gets the TimestampType object. |
Constructor Summary | |
---|---|
DataTypes()
|
Method Summary | |
---|---|
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 DecimalType |
createDecimalType()
|
static DecimalType |
createDecimalType(int precision,
int scale)
|
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,
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 ). |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final DataType StringType
public static final DataType BinaryType
public static final DataType BooleanType
public static final DataType DateType
public static final DataType TimestampType
public static final DataType DoubleType
public static final DataType FloatType
public static final DataType ByteType
public static final DataType IntegerType
public static final DataType LongType
public static final DataType ShortType
public static final DataType NullType
Constructor Detail |
---|
public DataTypes()
Method Detail |
---|
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 DecimalType createDecimalType(int precision, int scale)
public static DecimalType createDecimalType()
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, 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)
createStructField(String, DataType, boolean, Metadata)
public static StructType createStructType(java.util.List<StructField> fields)
fields
).
public static StructType createStructType(StructField[] fields)
fields
).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |