YearMonthIntervalType (Spark 4.2.0 JavaDoc)
- All Implemented Interfaces:
Serializable,scala.Equals,scala.Product
public class YearMonthIntervalType extends DataType implements scala.Product, Serializable
The type represents year-month intervals of the SQL standard. A year-month interval is made up of a contiguous subset of the following fields: - MONTH, months within years [0..11], - YEAR, years in the range [0..178956970].
YearMonthIntervalType represents positive as well as negative year-month intervals.
param: startField The leftmost field which the type comprises of. Valid values: 0 (YEAR), 1 (MONTH). param: endField The rightmost field which the type comprises of. Valid values: 0 (YEAR), 1 (MONTH).
- Since:
- 3.2.0
- See Also:
-
Constructor Summary
Constructors
YearMonthIntervalType(byte startField, byte endField) -
Method Summary
apply()apply(byte field) abstract static booleanDEFAULT()intYear-month interval values always occupy 4 bytes.
byteendField()abstract static booleanfieldToString(byte field) static byteMONTH()abstract static intproductElement(int n) productElementName(int n) static scala.collection.Iterator<String>static scala.collection.Iterator<Object>bytestatic scala.collection.immutable.Map<String,Object> typeName()Name of the type used in JSON serialization.
static byteYEAR()static scala.collection.immutable.Seq<Object>Methods inherited from class org.apache.spark.sql.types.DataType
catalogString, COLLATIONS_METADATA_KEY, equalsIgnoreCaseAndNullability, equalsIgnoreNullability, equalsStructurally, equalsStructurallyByName, fromDDL, fromJson, json, parseTypeWithFallback, prettyJson, simpleString, sqlMethods inherited from interface scala.Equals
canEqual, equalsMethods inherited from interface scala.Product
productArity, productElement, productElementName, productElementNames, productIterator, productPrefix
-
Constructor Details
-
YearMonthIntervalType
public YearMonthIntervalType
(byte startField, byte endField)
-
-
Method Details
-
YEAR
public static byte YEAR()
-
MONTH
public static byte MONTH()
-
yearMonthFields
public static scala.collection.immutable.Seq<Object> yearMonthFields()
-
fieldToString
public static String fieldToString
(byte field) -
stringToField
public static scala.collection.immutable.Map<String,
Object> stringToField() -
DEFAULT
-
apply
-
apply
-
canEqual
public abstract static boolean canEqual
(Object that) -
equals
public abstract static boolean equals
(Object that) -
productArity
public abstract static int productArity()
-
productElement
public abstract static Object productElement
(int n) -
productIterator
public static scala.collection.Iterator<Object> productIterator()
-
productPrefix
public static String productPrefix()
-
productElementName
public static String productElementName
(int n) -
productElementNames
public static scala.collection.Iterator<String> productElementNames()
-
startField
public byte startField()
-
endField
public byte endField()
-
defaultSize
public int defaultSize()
Year-month interval values always occupy 4 bytes. The YEAR field is constrained by the upper bound 178956970 to fit to
Int.- Specified by:
defaultSizein classDataType- Returns:
- (undocumented)
-
typeName
Description copied from class:
DataTypeName of the type used in JSON serialization.
-