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
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic YearMonthIntervalTypeapply()static YearMonthIntervalTypeapply(byte field) abstract static booleanstatic YearMonthIntervalTypeDEFAULT()intYear-month interval values always occupy 4 bytes.byteendField()abstract static booleanstatic StringfieldToString(byte field) static byteMONTH()abstract static intabstract static ObjectproductElement(int n) static StringproductElementName(int n) static scala.collection.Iterator<String>static scala.collection.Iterator<Object>static StringbytetypeName()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 class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
fieldToString
-
stringToField
-
DEFAULT
-
apply
-
apply
-
canEqual
-
equals
-
productArity
public abstract static int productArity() -
productElement
-
productIterator
-
productPrefix
-
productElementName
-
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 toInt.- Specified by:
defaultSizein classDataType- Returns:
- (undocumented)
-
typeName
Description copied from class:DataTypeName of the type used in JSON serialization.
-