Author: tomwhite
Date: Wed Sep 17 13:12:42 2014
New Revision: 1625574

URL: http://svn.apache.org/r1625574
Log:
AVRO-739. Add date, time, timestamp, and duration binary types to 
specification. Contributed by Dmitry Kovalev and Ryan Blue.

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/doc/src/content/xdocs/spec.xml

Modified: avro/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1625574&r1=1625573&r2=1625574&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Wed Sep 17 13:12:42 2014
@@ -6,6 +6,9 @@ Trunk (not yet released)
 
     AVRO-1555.  C#: Add support for RPC over HTTP. (Dmitry Kovalev via cutting)
 
+    AVRO-739. Add date, time, timestamp, and duration binary types to
+    specification. (Dmitry Kovalev and Ryan Blue via tomwhite)
+
   OPTIMIZATIONS
 
   IMPROVEMENTS

Modified: avro/trunk/doc/src/content/xdocs/spec.xml
URL: 
http://svn.apache.org/viewvc/avro/trunk/doc/src/content/xdocs/spec.xml?rev=1625574&r1=1625573&r2=1625574&view=diff
==============================================================================
--- avro/trunk/doc/src/content/xdocs/spec.xml (original)
+++ avro/trunk/doc/src/content/xdocs/spec.xml Wed Sep 17 13:12:42 2014
@@ -1406,6 +1406,47 @@ void initFPTable() {
           precisions match.</p>
 
       </section>
+
+      <section>
+        <title>Date</title>
+        <p>
+          The <code>date</code> logical type represents a date within the 
calendar, with no reference to a particular time zone or time of day.
+        </p>
+        <p>
+          A <code>date</code> logical type annotates Avro <code>int</code> 
type, where the int stores the number of days from the unix epoch, 1 January 
1970 (ISO calendar).
+        </p>
+      </section>
+
+      <section>
+        <title>Time (millisecond precision)</title>
+        <p>
+          The <code>time-millis</code> logical type represents a time of day, 
with no reference to a particular calendar, time zone or date, with a precision 
of one millisecond.
+        </p>
+        <p>
+          A <code>time-millis</code> logical type annotates Avro 
<code>int</code> type, where the int stores the number of milliseconds after 
midnight, 00:00:00.000.
+        </p>
+      </section>
+
+      <section>
+        <title>Timestamp (millisecond precision)</title>
+        <p>
+          The <code>timestamp-millis</code> logical type represents an instant 
on the global timeline, independent of a particular time zone or calendar, with 
a precision of one millisecond.
+        </p>
+        <p>
+          A <code>timestamp-millis</code> logical type annotates Avro 
<code>long</code> type, where the long stores the number of milliseconds from 
the unix epoch, 1 January 1970 00:00:00.000 UTC.
+        </p>
+      </section>
+
+      <section>
+        <title>Duration</title>
+        <p>
+          The <code>duration</code> logical type represents an amount of time 
defined by a number of months, days and milliseconds. This is not equivalent to 
a number of milliseconds, because, depending on the moment in time from which 
the duration is measured, the number of days in the month and number of 
milliseconds in a day may differ. Other standard periods such as years, 
quarters, hours and minutes can be expressed through these basic periods.
+        </p>
+        <p>
+          A <code>duration</code> logical type annotates Avro 
<code>fixed</code> type of size 12, which stores three little-endian unsigned 
integers that represent durations at different granularities of time. The first 
stores a number in months, the second stores a number in days, and the third 
stores a number in milliseconds.
+        </p>
+      </section>
+
     </section>
 
   <p><em>Apache Avro, Avro, Apache, and the Avro and Apache logos are


Reply via email to