Class ParquetTimestampUtils
java.lang.Object
org.gridgain.internal.sql.copy.parquet.ParquetTimestampUtils
Collection of util methods for working with parquet timestamps.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.parquet.schema.LogicalTypeAnnotation.TimestampLogicalTypeAnnotationTimestamp in microseconds not adjusted to UTC.static final org.apache.parquet.schema.LogicalTypeAnnotation.TimestampLogicalTypeAnnotationTimestamp in microseconds adjusted to UTC.static final org.apache.parquet.schema.LogicalTypeAnnotation.TimestampLogicalTypeAnnotationTimestamp in milliseconds not adjusted to UTC.static final org.apache.parquet.schema.LogicalTypeAnnotation.TimestampLogicalTypeAnnotationTimestamp in milliseconds adjusted to UTC. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetJulianDay(LocalDateTime timestamp) Returns julian day from timestamp.static longgetTimeOfDayNanos(LocalDateTime timestamp) Returns nanoseconds since midnight from timestamp.static LocalDateTimegetTimestamp(long value, org.apache.parquet.schema.LogicalTypeAnnotation typeAnnotation) Converts long value to timestamp based on provided annotation.static longgetTimestampMillis(org.apache.parquet.io.api.Binary timestampBinary) Returns GMT timestamp from binary encoded parquet timestamp (12 bytes - julian date + time of day nanos).static booleanisInt64Timestamp(org.apache.parquet.schema.LogicalTypeAnnotation typeAnnotation) Detects if given annotation is one of the supported timestamp types.
-
Field Details
-
TIMESTAMP_MILLIS_UTC
public static final org.apache.parquet.schema.LogicalTypeAnnotation.TimestampLogicalTypeAnnotation TIMESTAMP_MILLIS_UTCTimestamp in milliseconds adjusted to UTC. -
TIMESTAMP_MILLIS
public static final org.apache.parquet.schema.LogicalTypeAnnotation.TimestampLogicalTypeAnnotation TIMESTAMP_MILLISTimestamp in milliseconds not adjusted to UTC. -
TIMESTAMP_MICROS_UTC
public static final org.apache.parquet.schema.LogicalTypeAnnotation.TimestampLogicalTypeAnnotation TIMESTAMP_MICROS_UTCTimestamp in microseconds adjusted to UTC. -
TIMESTAMP_MICROS
public static final org.apache.parquet.schema.LogicalTypeAnnotation.TimestampLogicalTypeAnnotation TIMESTAMP_MICROSTimestamp 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
Returns julian day from timestamp. -
getTimeOfDayNanos
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.
-