Package org.apache.spark.sql.types
Class YearMonthIntervalType
Object
org.apache.spark.sql.types.DataType
org.apache.spark.sql.types.YearMonthIntervalType
- All Implemented Interfaces:
Serializable
,scala.Equals
,scala.Product
,scala.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
-
Method Summary
Modifier and TypeMethodDescriptionstatic YearMonthIntervalType
apply()
static YearMonthIntervalType
apply
(byte field) abstract static boolean
static YearMonthIntervalType
DEFAULT()
int
Year-month interval values always occupy 4 bytes.byte
endField()
abstract static boolean
static String
fieldToString
(byte field) static byte
MONTH()
abstract static int
abstract static Object
productElement
(int n) static scala.collection.Iterator<Object>
static String
byte
typeName()
Name of the type used in JSON serialization.static byte
YEAR()
static scala.collection.Seq<Object>
Methods inherited from class org.apache.spark.sql.types.DataType
catalogString, equalsIgnoreCaseAndNullability, equalsIgnoreNullability, equalsStructurally, equalsStructurallyByName, fromDDL, fromJson, json, parseTypeWithFallback, prettyJson, simpleString, sql
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface scala.Equals
canEqual, equals
Methods inherited from interface scala.Product
productArity, productElement, productIterator, productPrefix
-
Constructor Details
-
YearMonthIntervalType
public YearMonthIntervalType(byte startField, byte endField)
-
-
Method Details
-
YEAR
public static byte YEAR() -
MONTH
public static byte MONTH() -
yearMonthFields
-
fieldToString
-
stringToField
-
DEFAULT
-
apply
-
apply
-
canEqual
-
equals
-
productElement
-
productArity
public abstract static int productArity() -
productIterator
-
productPrefix
-
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 toInt
.- Specified by:
defaultSize
in classDataType
- Returns:
- (undocumented)
-
typeName
Description copied from class:DataType
Name of the type used in JSON serialization.
-