Class ParquetTimestampUtils

java.lang.Object
org.gridgain.internal.sql.copy.parquet.ParquetTimestampUtils

public class ParquetTimestampUtils extends Object
Collection of util methods for working with parquet timestamps.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.apache.parquet.schema.LogicalTypeAnnotation.TimestampLogicalTypeAnnotation
    Timestamp in microseconds not adjusted to UTC.
    static final org.apache.parquet.schema.LogicalTypeAnnotation.TimestampLogicalTypeAnnotation
    Timestamp in microseconds adjusted to UTC.
    static final org.apache.parquet.schema.LogicalTypeAnnotation.TimestampLogicalTypeAnnotation
    Timestamp in milliseconds not adjusted to UTC.
    static final org.apache.parquet.schema.LogicalTypeAnnotation.TimestampLogicalTypeAnnotation
    Timestamp in milliseconds adjusted to UTC.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    Returns julian day from timestamp.
    static long
    Returns nanoseconds since midnight from timestamp.
    getTimestamp(long value, org.apache.parquet.schema.LogicalTypeAnnotation typeAnnotation)
    Converts long value to timestamp based on provided annotation.
    static long
    getTimestampMillis(org.apache.parquet.io.api.Binary timestampBinary)
    Returns GMT timestamp from binary encoded parquet timestamp (12 bytes - julian date + time of day nanos).
    static boolean
    isInt64Timestamp(org.apache.parquet.schema.LogicalTypeAnnotation typeAnnotation)
    Detects if given annotation is one of the supported timestamp types.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • TIMESTAMP_MILLIS_UTC

      public static final org.apache.parquet.schema.LogicalTypeAnnotation.TimestampLogicalTypeAnnotation TIMESTAMP_MILLIS_UTC
      Timestamp in milliseconds adjusted to UTC.
    • TIMESTAMP_MILLIS

      public static final org.apache.parquet.schema.LogicalTypeAnnotation.TimestampLogicalTypeAnnotation TIMESTAMP_MILLIS
      Timestamp in milliseconds not adjusted to UTC.
    • TIMESTAMP_MICROS_UTC

      public static final org.apache.parquet.schema.LogicalTypeAnnotation.TimestampLogicalTypeAnnotation TIMESTAMP_MICROS_UTC
      Timestamp in microseconds adjusted to UTC.
    • TIMESTAMP_MICROS

      public static final org.apache.parquet.schema.LogicalTypeAnnotation.TimestampLogicalTypeAnnotation TIMESTAMP_MICROS
      Timestamp in microseconds not adjusted to UTC.
  • Constructor Details

    • ParquetTimestampUtils

      public ParquetTimestampUtils()
  • Method Details

    • getTimestampMillis

      public static long getTimestampMillis(org.apache.parquet.io.api.Binary timestampBinary)
      Returns GMT timestamp from binary encoded parquet timestamp (12 bytes - julian date + time of day nanos).
      Parameters:
      timestampBinary - INT96 parquet timestamp
      Returns:
      timestamp in millis, GMT timezone
    • getJulianDay

      public static int getJulianDay(LocalDateTime timestamp)
      Returns julian day from timestamp.
    • getTimeOfDayNanos

      public static long getTimeOfDayNanos(LocalDateTime timestamp)
      Returns nanoseconds since midnight from timestamp.
    • isInt64Timestamp

      public static boolean isInt64Timestamp(org.apache.parquet.schema.LogicalTypeAnnotation typeAnnotation)
      Detects if given annotation is one of the supported timestamp types.
    • getTimestamp

      public static LocalDateTime getTimestamp(long value, org.apache.parquet.schema.LogicalTypeAnnotation typeAnnotation)
      Converts long value to timestamp based on provided annotation.