Packages

object IntervalUtils

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. IntervalUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def add(left: CalendarInterval, right: CalendarInterval): CalendarInterval

    Return a new calendar interval instance of the sum of two intervals.

  5. 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

    ArithmeticException if the result overflows any field value

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def castDayTimeStringToInterval(input: String, startField: Byte, endField: Byte): CalendarInterval
  8. def castStringToDTInterval(input: UTF8String, startField: Byte, endField: Byte): Long
  9. def castStringToYMInterval(input: UTF8String, startField: Byte, endField: Byte): Int
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  11. def dayTimeIntervalToByte(v: Long, startField: Byte, endField: Byte): Byte
  12. def dayTimeIntervalToDecimal(v: Long, endField: Byte): Decimal
  13. def dayTimeIntervalToInt(v: Long, startField: Byte, endField: Byte): Int
  14. def dayTimeIntervalToLong(v: Long, startField: Byte, endField: Byte): Long
  15. def dayTimeIntervalToShort(v: Long, startField: Byte, endField: Byte): Short
  16. def decimalToDayTimeInterval(d: Decimal, p: Int, s: Int, startField: Byte, endField: Byte): Long
  17. def decimalToYearMonthInterval(d: Decimal, p: Int, s: Int, startField: Byte, endField: Byte): Int
  18. def divide(interval: CalendarInterval, num: Double): CalendarInterval

    Return a new calendar interval instance of the left interval divides by a dividend.

  19. 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

    ArithmeticException if the result overflows any field value or divided by zero

  20. def durationToMicros(duration: Duration, endField: Byte): Long
  21. def durationToMicros(duration: Duration): Long

    Converts this duration to the total length in microseconds.

    Converts this duration to the total length in microseconds.

    If this duration is too large to fit in a Long microseconds, then an exception is thrown.

    If this duration has greater than microsecond precision, then the conversion will drop any excess precision information as though the amount in nanoseconds was subject to integer division by one thousand.

    returns

    The total length of the duration in microseconds

    Exceptions thrown

    ArithmeticException If numeric overflow occurs

  22. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  24. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  25. 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)

  26. 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

  27. def fromIntervalString(input: String): CalendarInterval

    Parse all kinds of interval literals including unit-to-unit form and unit list form

  28. 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)

  29. 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

  30. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  31. def getDays(interval: CalendarInterval): Int
  32. def getDays(microseconds: Long): Int
  33. 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

  34. def getHours(interval: CalendarInterval): Byte
  35. def getHours(microseconds: Long): Byte
  36. def getMinutes(interval: CalendarInterval): Byte
  37. def getMinutes(microseconds: Long): Byte
  38. def getMonths(interval: CalendarInterval): Byte
  39. def getMonths(months: Int): Byte
  40. def getSeconds(interval: CalendarInterval): Decimal
  41. def getSeconds(microseconds: Long): Decimal
  42. def getYears(interval: CalendarInterval): Int
  43. def getYears(months: Int): Int
  44. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  45. def intToDayTimeInterval(v: Int, startField: Byte, endField: Byte): Long
  46. def intToYearMonthInterval(v: Int, startField: Byte, endField: Byte): Int
  47. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  48. 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

  49. def longToDayTimeInterval(v: Long, startField: Byte, endField: Byte): Long
  50. def longToYearMonthInterval(v: Long, startField: Byte, endField: Byte): Int
  51. def makeDayTimeInterval(days: Int, hours: Int, mins: Int, secs: Decimal): Long
  52. def makeInterval(years: Int, months: Int, weeks: Int, days: Int, hours: Int, mins: Int, secs: Decimal): CalendarInterval
  53. def microsToDuration(micros: Long): Duration

    Obtains a Duration representing a number of microseconds.

    Obtains a Duration representing a number of microseconds.

    micros

    The number of microseconds, positive or negative

    returns

    A Duration, not null

  54. def monthsToPeriod(months: Int): Period

    Obtains a Period representing a number of months.

    Obtains a Period representing a number of months. The days unit will be zero, and the years and months units will be normalized.

    The months unit is adjusted to have an absolute value < 12, with the years unit being adjusted to compensate. For example, the method returns "2 years and 3 months" for the 27 input months.

    The sign of the years and months units will be the same after normalization. For example, -13 months will be converted to "-1 year and -1 month".

    months

    The number of months, positive or negative

    returns

    The period of months, not null

  55. def multiply(interval: CalendarInterval, num: Double): CalendarInterval

    Return a new calendar interval instance of the left interval times a multiplier.

  56. 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

    ArithmeticException if the result overflows any field value

  57. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  58. def negate(interval: CalendarInterval): CalendarInterval

    Unary minus, return the negated the calendar interval value.

  59. 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

    ArithmeticException if the result overflows any field value

  60. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  61. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  62. def periodToMonths(period: Period, endField: Byte): Int
  63. def periodToMonths(period: Period): Int

    Gets the total number of months in this period.

    Gets the total number of months in this period.

    This returns the total number of months in the period by multiplying the number of years by 12 and adding the number of months.

    returns

    The total number of months in the period, may be negative

    Exceptions thrown

    ArithmeticException If numeric overflow occurs

  64. def safeStringToInterval(input: UTF8String): CalendarInterval

    A safe version of stringToInterval.

    A safe version of stringToInterval. It returns null for invalid input string.

  65. def stringToInterval(input: UTF8String): CalendarInterval

    Converts a string to CalendarInterval case-insensitively.

    Converts a string to CalendarInterval case-insensitively.

    Exceptions thrown

    IllegalArgumentException if the input string is not in valid interval format.

  66. def subtract(left: CalendarInterval, right: CalendarInterval): CalendarInterval

    Return a new calendar interval instance of the left interval minus the right one.

  67. 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

    ArithmeticException if the result overflows any field value

  68. val supportedFormat: Map[(Byte, Byte), Seq[String]]
  69. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  70. def toDTInterval(minute: String, second: String, sign: Int): Long
  71. def toDTInterval(hour: String, minute: String, second: String, sign: Int): Long
  72. def toDTInterval(day: String, hour: String, minute: String, second: String, sign: Int): Long
  73. def toDayTimeIntervalString(micros: Long, style: IntervalStyle, startField: Byte, endField: Byte): String

    Converts a day-time interval as a number of microseconds to its textual representation which conforms to the ANSI SQL standard.

    Converts a day-time interval as a number of microseconds to its textual representation which conforms to the ANSI SQL standard.

    micros

    The number of microseconds, positive or negative

    style

    The style of textual representation of the interval

    startField

    The start field (DAY, HOUR, MINUTE, SECOND) which the interval comprises of.

    endField

    The end field (DAY, HOUR, MINUTE, SECOND) which the interval comprises of.

    returns

    Day-time interval string

  74. def toString(): String
    Definition Classes
    AnyRef → Any
  75. def toYearMonthIntervalString(months: Int, style: IntervalStyle, startField: Byte, endField: Byte): String

    Converts an year-month interval as a number of months to its textual representation which conforms to the ANSI SQL standard.

    Converts an year-month interval as a number of months to its textual representation which conforms to the ANSI SQL standard.

    months

    The number of months, positive or negative

    style

    The style of textual representation of the interval

    startField

    The start field (YEAR or MONTH) which the interval comprises of.

    endField

    The end field (YEAR or MONTH) which the interval comprises of.

    returns

    Year-month interval string

  76. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  77. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  78. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  79. def yearMonthIntervalToByte(v: Int, startField: Byte, endField: Byte): Byte
  80. def yearMonthIntervalToInt(v: Int, startField: Byte, endField: Byte): Int
  81. def yearMonthIntervalToShort(v: Int, startField: Byte, endField: Byte): Short

Inherited from AnyRef

Inherited from Any

Ungrouped