You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@parquet.apache.org by ga...@apache.org on 2018/08/28 12:57:21 UTC
[parquet-format] branch master updated: PARQUET-1387: Nanosecond
precision time and timestamp - parquet-format (#102)
This is an automated email from the ASF dual-hosted git repository.
gabor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/parquet-format.git
The following commit(s) were added to refs/heads/master by this push:
new b879065 PARQUET-1387: Nanosecond precision time and timestamp - parquet-format (#102)
b879065 is described below
commit b879065ac1bee3fe1d770eb3c4b60ab4267044d7
Author: nandorKollar <na...@users.noreply.github.com>
AuthorDate: Tue Aug 28 14:57:19 2018 +0200
PARQUET-1387: Nanosecond precision time and timestamp - parquet-format (#102)
---
LogicalTypes.md | 14 ++++++++++++--
src/main/thrift/parquet.thrift | 4 +++-
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/LogicalTypes.md b/LogicalTypes.md
index 3be6f21..4c103e2 100644
--- a/LogicalTypes.md
+++ b/LogicalTypes.md
@@ -256,7 +256,7 @@ The sort order used for `DATE` is signed.
`TIME` is used for a logical time type without a date with millisecond or microsecond precision.
The type has two type parameters: UTC adjustment (`true` or `false`)
-and precision (`MILLIS` or `MICROS`).
+and precision (`MILLIS` or `MICROS`, `NANOS`).
`TIME` with precision `MILLIS` is used for millisecond precision.
It must annotate an `int32` that stores the number of
@@ -266,6 +266,10 @@ milliseconds after midnight.
It must annotate an `int64` that stores the number of
microseconds after midnight.
+`TIME` with precision `NANOS` is used for nanosecond precision.
+It must annotate an `int64` that stores the number of
+nanoseconds after midnight.
+
The sort order used for `TIME` is signed.
#### Deprecated time ConvertedType
@@ -305,7 +309,7 @@ with precision `MICROS`. Like the logical type counterpart, it must annotate an
`TIMESTAMP` is used for a combined logical date and time type, with
millisecond or microsecond precision. The type has two type parameters:
-UTC adjustment (`true` or `false`) and precision (`MILLIS` or `MICROS`).
+UTC adjustment (`true` or `false`) and precision (`MILLIS` or `MICROS`, `NANOS`).
`TIMESTAMP` with precision `MILLIS` is used for millisecond precision.
It must annotate an `int64` that stores the number of
@@ -315,6 +319,12 @@ milliseconds from the Unix epoch, 00:00:00.000 on 1 January 1970, UTC.
It must annotate an `int64` that stores the number of
microseconds from the Unix epoch, 00:00:00.000000 on 1 January 1970, UTC.
+`TIMESTAMP` with precision `NANOS` is used for nanosecond precision.
+It must annotate an `int64` that stores the number of
+nanoseconds from the Unix epoch, 00:00:00.000000000 on 1 January 1970, UTC.
+Valid values for nanosecond precision are between
+00:12:43 21 September 1677 UTC and 23:47:16 11 April 2262 UTC.
+
The sort order used for `TIMESTAMP` is signed.
#### Deprecated timestamp ConvertedType
diff --git a/src/main/thrift/parquet.thrift b/src/main/thrift/parquet.thrift
index 87fb81c..c05e871 100644
--- a/src/main/thrift/parquet.thrift
+++ b/src/main/thrift/parquet.thrift
@@ -257,9 +257,11 @@ struct DecimalType {
/** Time units for logical types */
struct MilliSeconds {}
struct MicroSeconds {}
+struct NanoSeconds {}
union TimeUnit {
1: MilliSeconds MILLIS
2: MicroSeconds MICROS
+ 3: NanoSeconds NANOS
}
/**
@@ -275,7 +277,7 @@ struct TimestampType {
/**
* Time logical type annotation
*
- * Allowed for physical types: INT32 (millis), INT64 (micros)
+ * Allowed for physical types: INT32 (millis), INT64 (micros, nanos)
*/
struct TimeType {
1: required bool isAdjustedToUTC