Class ParquetReaderUtility.NanoTimeUtils
java.lang.Object
org.apache.drill.exec.store.parquet.ParquetReaderUtility.NanoTimeUtils
- Enclosing class:
- ParquetReaderUtility
Utilities for converting from parquet INT96 binary (impala, hive timestamp)
to date time value. This utilizes the Joda library.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
getDateTimeValueFromBinary
(org.apache.parquet.io.api.Binary binaryTimeStampValue, boolean retainLocalTimezone)
-
Field Details
-
NANOS_PER_MILLISECOND
public static final long NANOS_PER_MILLISECOND- See Also:
-
-
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.
-