object IntervalUtils
- Alphabetic
- By Inheritance
- IntervalUtils
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
add(left: CalendarInterval, right: CalendarInterval): CalendarInterval
Return a new calendar interval instance of the sum of two intervals.
-
def
addExact(left: CalendarInterval, right: CalendarInterval): CalendarInterval
Return a new calendar interval instance of the sum of two intervals.
Return a new calendar interval instance of the sum of two intervals.
- Exceptions thrown
ArithmeticExceptionif the result overflows any field value
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
divide(interval: CalendarInterval, num: Double): CalendarInterval
Return a new calendar interval instance of the left interval divides by a dividend.
-
def
divideExact(interval: CalendarInterval, num: Double): CalendarInterval
Return a new calendar interval instance of the left interval divides by a dividend.
Return a new calendar interval instance of the left interval divides by a dividend.
- Exceptions thrown
ArithmeticExceptionif the result overflows any field value or divided by zero
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
fromDayTimeString(input: String, from: IntervalUnit, to: IntervalUnit): CalendarInterval
Parse dayTime string in form: [-]d HH:mm:ss.nnnnnnnnn and [-]HH:mm:ss.nnnnnnnnn
Parse dayTime string in form: [-]d HH:mm:ss.nnnnnnnnn and [-]HH:mm:ss.nnnnnnnnn
adapted from HiveIntervalDayTime.valueOf. Below interval conversion patterns are supported: - DAY TO (HOUR|MINUTE|SECOND) - HOUR TO (MINUTE|SECOND) - MINUTE TO SECOND
-
def
fromDayTimeString(s: String): CalendarInterval
Parse dayTime string in form: [-]d HH:mm:ss.nnnnnnnnn and [-]HH:mm:ss.nnnnnnnnn
Parse dayTime string in form: [-]d HH:mm:ss.nnnnnnnnn and [-]HH:mm:ss.nnnnnnnnn
adapted from HiveIntervalDayTime.valueOf
-
def
fromYearMonthString(input: String): CalendarInterval
Parse YearMonth string in form: [+|-]YYYY-MM
Parse YearMonth string in form: [+|-]YYYY-MM
adapted from HiveIntervalYearMonth.valueOf
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getDays(interval: CalendarInterval): Int
-
def
getDuration(interval: CalendarInterval, targetUnit: TimeUnit, daysPerMonth: Int = 31): Long
Gets interval duration
Gets interval duration
- interval
The interval to get duration
- targetUnit
Time units of the result
- daysPerMonth
The number of days per one month. The default value is 31 days per month. This value was taken as the default because it is used in Structured Streaming for watermark calculations. Having 31 days per month, we can guarantee that events are not dropped before the end of any month (February with 29 days or January with 31 days).
- returns
Duration in the specified time units
- def getHours(interval: CalendarInterval): Long
- def getMinutes(interval: CalendarInterval): Byte
- def getMonths(interval: CalendarInterval): Byte
- def getSeconds(interval: CalendarInterval): Decimal
- def getYears(interval: CalendarInterval): Int
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isNegative(interval: CalendarInterval, daysPerMonth: Int = 31): Boolean
Checks the interval is negative
Checks the interval is negative
- interval
The checked interval
- daysPerMonth
The number of days per one month. The default value is 31 days per month. This value was taken as the default because it is used in Structured Streaming for watermark calculations. Having 31 days per month, we can guarantee that events are not dropped before the end of any month (February with 29 days or January with 31 days).
- returns
true if duration of the given interval is less than 0 otherwise false
- def makeInterval(years: Int, months: Int, weeks: Int, days: Int, hours: Int, mins: Int, secs: Decimal): CalendarInterval
-
def
multiply(interval: CalendarInterval, num: Double): CalendarInterval
Return a new calendar interval instance of the left interval times a multiplier.
-
def
multiplyExact(interval: CalendarInterval, num: Double): CalendarInterval
Return a new calendar interval instance of the left interval times a multiplier.
Return a new calendar interval instance of the left interval times a multiplier.
- Exceptions thrown
ArithmeticExceptionif the result overflows any field value
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
negate(interval: CalendarInterval): CalendarInterval
Unary minus, return the negated the calendar interval value.
-
def
negateExact(interval: CalendarInterval): CalendarInterval
Unary minus, return the negated the calendar interval value.
Unary minus, return the negated the calendar interval value.
- Exceptions thrown
ArithmeticExceptionif the result overflows any field value
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
safeStringToInterval(input: UTF8String): CalendarInterval
A safe version of
stringToInterval.A safe version of
stringToInterval. It returns null for invalid input string. -
def
stringToInterval(input: UTF8String): CalendarInterval
Converts a string to CalendarInterval case-insensitively.
Converts a string to CalendarInterval case-insensitively.
- Exceptions thrown
IllegalArgumentExceptionif the input string is not in valid interval format.
-
def
subtract(left: CalendarInterval, right: CalendarInterval): CalendarInterval
Return a new calendar interval instance of the left interval minus the right one.
-
def
subtractExact(left: CalendarInterval, right: CalendarInterval): CalendarInterval
Return a new calendar interval instance of the left interval minus the right one.
Return a new calendar interval instance of the left interval minus the right one.
- Exceptions thrown
ArithmeticExceptionif the result overflows any field value
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- object IntervalUnit extends Enumeration