package types
Type Members
- final class ByteArray extends AnyRef
- final class CalendarInterval extends Serializable with Comparable[CalendarInterval]
The class representing calendar intervals.
The class representing calendar intervals. The calendar interval is stored internally in three components:
- an integer value representing the number of
monthsin this interval, - an integer value representing the number of
daysin this interval, - a long value representing the number of
microsecondsin this interval.
The
monthsanddaysare not units of time with a constant length (unlike hours, seconds), so they are two separated fields from microseconds. One month may be equal to 28, 29, 30 or 31 days and one day may be equal to 23, 24 or 25 hours (daylight saving).- Annotations
- @Unstable()
- Since
3.0.0
- an integer value representing the number of
- final class UTF8String extends Comparable[UTF8String] with Externalizable with KryoSerializable with Cloneable
A UTF-8 String for internal Spark use.
A UTF-8 String for internal Spark use.
A String encoded in UTF-8 as an Array[Byte], which can be used for comparison, search, see http://en.wikipedia.org/wiki/UTF-8 for details.
Note: This is not designed for general use cases, should not be used outside SQL.
- class VariantVal extends Serializable
The physical data representation of
org.apache.spark.sql.types.VariantTypethat represents a semi-structured value.The physical data representation of
org.apache.spark.sql.types.VariantTypethat represents a semi-structured value. It consists of two binary values:VariantVal#valueandVariantVal#metadata. The value encodes types and values, but not field names. The metadata currently contains a version flag and a list of field names. We can extend/modify the detailed binary format given the version flag.A
VariantValcan be produced by casting another value into the Variant type or parsing a JSON string in theorg.apache.spark.sql.catalyst.expressions.variant.ParseJsonexpression. We can extract a path consisting of field names and array indices from it, cast it into a concrete data type, or rebuild a JSON string from it.The storage layout of this class in
org.apache.spark.sql.catalyst.expressions.UnsafeRowandorg.apache.spark.sql.catalyst.expressions.UnsafeArrayDatais: the fixed-size part is a long value "offsetAndSize". The upper 32 bits is the offset that points to the start position of the actual binary content. The lower 32 bits is the total length of the binary content. The binary content contains: 4 bytes representing the length ofVariantVal#value, content ofVariantVal#value, content ofVariantVal#metadata. This is an internal and transient format and can be modified at any time.