Class ParquetReaderUtility.NanoTimeUtils

java.lang.Object
org.apache.drill.exec.store.parquet.ParquetReaderUtility.NanoTimeUtils
Enclosing class:
ParquetReaderUtility

public static class ParquetReaderUtility.NanoTimeUtils extends Object
Utilities for converting from parquet INT96 binary (impala, hive timestamp) to date time value. This utilizes the Joda library.
  • Field Details

  • Constructor Details

    • NanoTimeUtils

      public NanoTimeUtils()
  • Method Details

    • getDateTimeValueFromBinary

      public static long getDateTimeValueFromBinary(org.apache.parquet.io.api.Binary binaryTimeStampValue, boolean retainLocalTimezone)
      Parameters:
      binaryTimeStampValue - hive, impala timestamp values with nanoseconds precision are stored in parquet Binary as INT96 (12 constant bytes)
      retainLocalTimezone - parquet files don't keep local timeZone according to the Parquet spec, but some tools (hive, for example) retain local timezone for parquet files by default Note: Impala doesn't retain local timezone by default
      Returns:
      Timestamp in milliseconds - the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by @param binaryTimeStampValue. The nanos precision is cut to millis. Therefore the length of single timestamp value is 8 bytes instead of 12 bytes.