Class DefaultKernelUtils

Object
io.delta.kernel.defaults.internal.DefaultKernelUtils

public class DefaultKernelUtils extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static long
    daysToMicros(int days, ZoneOffset timezone)
    Converts a number of days since epoch (1970-01-01 00:00:00 UTC) to microseconds between epoch and start of the day in the given timezone.
    static long
    fromJulianDay(int days, long nanos)
    Returns the number of microseconds since epoch from Julian day and nanoseconds in a day.
    static io.delta.kernel.types.DataType
    getDataType(io.delta.kernel.types.StructType schema, io.delta.kernel.expressions.Column column)
    Search for the data type of the given column in the schema.
    static long
    millisToMicros(long millis)
     
    static long
    parseTimestampNTZ(String timestampString)
    Parses a TimestampNTZ string in UTC format, supporting milliseconds and microseconds, to microseconds since the Unix epoch.
    static io.delta.kernel.internal.util.Tuple2<Integer,Long>
    toJulianDay(long micros)
    Returns Julian day and remaining nanoseconds from the number of microseconds

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • fromJulianDay

      public static long fromJulianDay(int days, long nanos)
      Returns the number of microseconds since epoch from Julian day and nanoseconds in a day.
    • toJulianDay

      public static io.delta.kernel.internal.util.Tuple2<Integer,Long> toJulianDay(long micros)
      Returns Julian day and remaining nanoseconds from the number of microseconds

      Note: support timestamp since 4717 BC (without negative nanoseconds, compatible with Hive).

    • millisToMicros

      public static long millisToMicros(long millis)
    • daysToMicros

      public static long daysToMicros(int days, ZoneOffset timezone)
      Converts a number of days since epoch (1970-01-01 00:00:00 UTC) to microseconds between epoch and start of the day in the given timezone.
    • parseTimestampNTZ

      public static long parseTimestampNTZ(String timestampString)
      Parses a TimestampNTZ string in UTC format, supporting milliseconds and microseconds, to microseconds since the Unix epoch.
      Parameters:
      timestampString - the timestamp string to parse.
      Returns:
      the number of microseconds since epoch.
    • getDataType

      public static io.delta.kernel.types.DataType getDataType(io.delta.kernel.types.StructType schema, io.delta.kernel.expressions.Column column)
      Search for the data type of the given column in the schema.
      Parameters:
      schema - the schema to search
      column - the column whose data type is to be found
      Returns:
      the data type of the column
      Throws:
      IllegalArgumentException - if the column is not found in the schema