Spark1.1.0 Spark SQL Programming Guide
时间:2022-03-13 23:48
Data type
Value type in Scala
API to access or create a data type
ByteType
Byte
ByteType
ShortType
Short
ShortType
IntegerType
Int
IntegerType
LongType
Long
LongType
FloatType
Float
FloatType
DoubleType
Double
DoubleType
DecimalType
scala.math.sql.BigDecimal
DecimalType
StringType
String
StringType
BinaryType
Array[Byte]
BinaryType
BooleanType
Boolean
BooleanType
TimestampType
java.sql.Timestamp
TimestampType
ArrayType
scala.collection.Seq
ArrayType(elementType, [containsNull])
Note: The default value of containsNull is false.
MapType
scala.collection.Map
MapType(keyType, valueType, [valueContainsNull])
Note: The default value of valueContainsNull is true.
StructType
org.apache.spark.sql.Row
StructType(fields)
Note: fields is a Seq of StructFields. Also, two fields with the same name are not allowed.
StructField
The value type in Scala of the data type of this field (For example, Int for a StructField with the data type IntegerType)
StructField(name, dataType, nullable)
Note: The default value of containsNull is false.
Note: The default value of valueContainsNull is true.
Note: fields is a Seq of StructFields. Also, two fields with the same name are not allowed.