Package org.apache.spark.unsafe.types
Class CalendarInterval
Object
org.apache.spark.unsafe.types.CalendarInterval
- All Implemented Interfaces:
Serializable
The class representing calendar intervals. The calendar interval is stored internally in
three components:
- an integer value representing the number of `months` in this interval,
- an integer value representing the number of `days` in this interval,
- a long value representing the number of `microseconds` in this interval.
- Since:
- 3.0.0
- See Also:
-
Field Details
-
months
public final int months -
days
public final int days -
microseconds
public final long microseconds
-
-
Constructor Details
-
CalendarInterval
public CalendarInterval(int months, int days, long microseconds)
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
extractAsPeriod
Extracts the date part of the interval.- Returns:
- an instance of
java.time.Period
based on the months and days fields of the given interval, not null.
-
extractAsDuration
Extracts the time part of the interval.- Returns:
- an instance of
java.time.Duration
based on the microseconds field of the given interval, not null. - Throws:
ArithmeticException
- if a numeric overflow occurs
-