From 550a2821d30ccf675599da2f70a00bbe833dd14f Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Fri, 3 Feb 2017 19:40:14 +0100 Subject: [PATCH 1/2] PARQUET-861: Document INT96 timestamps --- LogicalTypes.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/LogicalTypes.md b/LogicalTypes.md index c411dbfad..39493ba01 100644 --- a/LogicalTypes.md +++ b/LogicalTypes.md @@ -144,6 +144,15 @@ example, there is no requirement that a large number of days should be expressed as a mix of months and days because there is not a constant conversion from days to months. +### INT96 timestamps (also called IMPALA_TIMESTAMP) + +_(deprecated)_ Timestamps saved as an `int96` are made up of the nanoseconds in the day +(first 8 byte) and the Julian day (last 4 bytes). No timezone is attached to this value. +To convert the timestamp into nanoseconds since the Unix epoch, 00:00:00.000000 +on 1 January 1970, the following formula can be used: +`(julian_day - 2440588) * (86400 * 1000 * 1000 * 1000) + nanoseconds`. +The magic number `2440588` is the julian day for 1 January 1970. + ## Embedded Types ### JSON From cb4727767823ae201fd567f67825cc22834c20e9 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Mon, 6 Feb 2017 16:57:04 +0100 Subject: [PATCH 2/2] Add note that there is no logical type annotation present for INT96 --- LogicalTypes.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/LogicalTypes.md b/LogicalTypes.md index 39493ba01..717b29030 100644 --- a/LogicalTypes.md +++ b/LogicalTypes.md @@ -153,6 +153,9 @@ on 1 January 1970, the following formula can be used: `(julian_day - 2440588) * (86400 * 1000 * 1000 * 1000) + nanoseconds`. The magic number `2440588` is the julian day for 1 January 1970. +Note that these timestamps are the common usage of the `int96` physical type and are not +marked with a special logical type annotation. + ## Embedded Types ### JSON