object IntervalUtils extends SparkIntervalUtils
- Alphabetic
- By Inheritance
- IntervalUtils
- SparkIntervalUtils
- 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
-
val
MAX_DAY: Long
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils
-
val
MAX_HOUR: Long
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils
-
val
MAX_MINUTE: Long
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils
-
val
MAX_SECOND: Long
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils
-
val
MIN_SECOND: Long
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils
-
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 castDayTimeStringToInterval(input: String, startField: Byte, endField: Byte): CalendarInterval
- def castStringToDTInterval(input: UTF8String, startField: Byte, endField: Byte): Long
- def castStringToYMInterval(input: UTF8String, startField: Byte, endField: Byte): Int
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
val
dayStr: UTF8String
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils
- def dayTimeIntervalToByte(v: Long, startField: Byte, endField: Byte): Byte
- def dayTimeIntervalToDecimal(v: Long, endField: Byte): Decimal
- def dayTimeIntervalToInt(v: Long, startField: Byte, endField: Byte): Int
- def dayTimeIntervalToLong(v: Long, startField: Byte, endField: Byte): Long
- def dayTimeIntervalToShort(v: Long, startField: Byte, endField: Byte): Short
- def decimalToDayTimeInterval(d: Decimal, p: Int, s: Int, startField: Byte, endField: Byte): Long
- def decimalToYearMonthInterval(d: Decimal, p: Int, s: Int, startField: Byte, endField: Byte): Int
-
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
-
def
durationToMicros(duration: Duration, endField: Byte): Long
- Definition Classes
- SparkIntervalUtils
-
def
durationToMicros(duration: Duration): Long
- Definition Classes
- SparkIntervalUtils
-
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: Byte, to: Byte): CalendarInterval
Parse day-time interval in form: [-]d HH:mm:ss.nnnnnnnnn and [-]HH:mm:ss.nnnnnnnnn
Parse day-time interval in form: [-]d HH:mm:ss.nnnnnnnnn and [-]HH:mm:ss.nnnnnnnnn
adapted from HiveIntervalDayTime.valueOf. Below interval conversion patterns are supported: - DAY TO (DAY|HOUR|MINUTE|SECOND) - HOUR TO (HOUR|MINUTE|SECOND) - MINUTE TO (MINUTE|SECOND)
-
def
fromDayTimeString(s: String): CalendarInterval
Parse day-time interval in form: [-]d HH:mm:ss.nnnnnnnnn and [-]HH:mm:ss.nnnnnnnnn
Parse day-time interval in form: [-]d HH:mm:ss.nnnnnnnnn and [-]HH:mm:ss.nnnnnnnnn
adapted from HiveIntervalDayTime.valueOf
-
def
fromIntervalString(input: String): CalendarInterval
Parse all kinds of interval literals including unit-to-unit form and unit list form
-
def
fromYearMonthString(input: String, startField: Byte, endField: Byte): CalendarInterval
Parse year-month interval in form: [+|-]YYYY-MM
Parse year-month interval in form: [+|-]YYYY-MM
adapted from HiveIntervalYearMonth.valueOf Below interval conversion patterns are supported: - YEAR TO (YEAR|MONTH)
-
def
fromYearMonthString(input: String): CalendarInterval
Parse year-month interval in form: [+|-]YYYY-MM
Parse year-month interval in form: [+|-]YYYY-MM
adapted from HiveIntervalYearMonth.valueOf
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getDays(interval: CalendarInterval): Int
- def getDays(microseconds: Long): 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): Byte
- def getHours(microseconds: Long): Byte
- def getMinutes(interval: CalendarInterval): Byte
- def getMinutes(microseconds: Long): Byte
- def getMonths(interval: CalendarInterval): Byte
- def getMonths(months: Int): Byte
- def getSeconds(interval: CalendarInterval): Decimal
- def getSeconds(microseconds: Long): Decimal
- def getYears(interval: CalendarInterval): Int
- def getYears(months: Int): Int
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
val
hourStr: UTF8String
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils
- def intToDayTimeInterval(v: Int, startField: Byte, endField: Byte): Long
- def intToYearMonthInterval(v: Int, startField: Byte, endField: Byte): Int
-
val
intervalStr: UTF8String
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils
-
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 longToDayTimeInterval(v: Long, startField: Byte, endField: Byte): Long
- def longToYearMonthInterval(v: Long, startField: Byte, endField: Byte): Int
- def makeDayTimeInterval(days: Int, hours: Int, mins: Int, secs: Decimal): Long
- def makeInterval(years: Int, months: Int, weeks: Int, days: Int, hours: Int, mins: Int, secs: Decimal): CalendarInterval
-
val
microsStr: UTF8String
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils
-
def
microsToDuration(micros: Long): Duration
- Definition Classes
- SparkIntervalUtils
-
val
millisStr: UTF8String
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils
-
val
minuteStr: UTF8String
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils
-
val
monthStr: UTF8String
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils
-
def
monthsToPeriod(months: Int): Period
- Definition Classes
- SparkIntervalUtils
-
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
-
val
nanosStr: UTF8String
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils
-
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
periodToMonths(period: Period, endField: Byte): Int
- Definition Classes
- SparkIntervalUtils
-
def
periodToMonths(period: Period): Int
- Definition Classes
- SparkIntervalUtils
-
def
safeStringToInterval(input: UTF8String): CalendarInterval
A safe version of
stringToInterval.A safe version of
stringToInterval. It returns null for invalid input string. -
val
secondStr: UTF8String
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils
-
def
stringToInterval(input: UTF8String): CalendarInterval
- Definition Classes
- SparkIntervalUtils
-
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
- val supportedFormat: Map[(String, Byte, Byte), Seq[String]]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- def toDTInterval(minute: String, second: String, sign: Int): Long
- def toDTInterval(hour: String, minute: String, second: String, sign: Int): Long
- def toDTInterval(day: String, hour: String, minute: String, second: String, sign: Int): Long
-
def
toDayTimeIntervalString(micros: Long, style: IntervalStyle, startField: Byte, endField: Byte): String
- Definition Classes
- SparkIntervalUtils
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
toYearMonthIntervalString(months: Int, style: IntervalStyle, startField: Byte, endField: Byte): String
- Definition Classes
- SparkIntervalUtils
-
def
unitToUtf8(unit: String): UTF8String
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils
-
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()
-
val
weekStr: UTF8String
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils
- def yearMonthIntervalToByte(v: Int, startField: Byte, endField: Byte): Byte
- def yearMonthIntervalToInt(v: Int, startField: Byte, endField: Byte): Int
- def yearMonthIntervalToShort(v: Int, startField: Byte, endField: Byte): Short
-
val
yearStr: UTF8String
- Attributes
- protected
- Definition Classes
- SparkIntervalUtils