Package org.apache.spark.sql.types
Class DayTimeIntervalType
Object
org.apache.spark.sql.types.DataType
org.apache.spark.sql.types.DayTimeIntervalType
- All Implemented Interfaces:
Serializable
,scala.Equals
,scala.Product
,scala.Serializable
The type represents day-time intervals of the SQL standard. A day-time interval is made up
of a contiguous subset of the following fields:
- SECOND, seconds within minutes and possibly fractions of a second [0..59.999999],
- MINUTE, minutes within hours [0..59],
- HOUR, hours within days [0..23],
- DAY, days in the range [0..106751991].
DayTimeIntervalType
represents positive as well as negative day-time intervals.
param: startField The leftmost field which the type comprises of. Valid values: 0 (DAY), 1 (HOUR), 2 (MINUTE), 3 (SECOND). param: endField The rightmost field which the type comprises of. Valid values: 0 (DAY), 1 (HOUR), 2 (MINUTE), 3 (SECOND).
- Since:
- 3.2.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DayTimeIntervalType
apply()
static DayTimeIntervalType
apply
(byte field) abstract static boolean
static byte
DAY()
static scala.collection.Seq<Object>
static DayTimeIntervalType
DEFAULT()
int
The day-time interval type has constant precision.byte
endField()
abstract static boolean
static String
fieldToString
(byte field) static byte
HOUR()
static byte
MINUTE()
abstract static int
abstract static Object
productElement
(int n) static scala.collection.Iterator<Object>
static String
static byte
SECOND()
byte
typeName()
Name of the type used in JSON serialization.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
-
DayTimeIntervalType
public DayTimeIntervalType(byte startField, byte endField)
-
-
Method Details
-
DAY
public static byte DAY() -
HOUR
public static byte HOUR() -
MINUTE
public static byte MINUTE() -
SECOND
public static byte SECOND() -
dayTimeFields
-
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()The day-time interval type has constant precision. A value of the type always occupies 8 bytes. The DAY field is constrained by the upper bound 106751991 to fit toLong
.- Specified by:
defaultSize
in classDataType
- Returns:
- (undocumented)
-
typeName
Description copied from class:DataType
Name of the type used in JSON serialization.
-