Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A1CAA200BC6 for ; Sat, 5 Nov 2016 21:20:22 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A0AE3160AE9; Sat, 5 Nov 2016 20:20:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C3B94160B12 for ; Sat, 5 Nov 2016 21:20:20 +0100 (CET) Received: (qmail 27364 invoked by uid 500); 5 Nov 2016 20:20:19 -0000 Mailing-List: contact commits-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@avro.apache.org Delivered-To: mailing list commits@avro.apache.org Received: (qmail 27124 invoked by uid 99); 5 Nov 2016 20:20:19 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Nov 2016 20:20:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2FF8CEEE2F; Sat, 5 Nov 2016 20:20:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: blue@apache.org To: commits@avro.apache.org Date: Sat, 05 Nov 2016 20:20:41 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [24/35] avro git commit: AVRO-1918: Improve logical type documentation. Contributed by Gabor Szadovszky. archived-at: Sat, 05 Nov 2016 20:20:22 -0000 AVRO-1918: Improve logical type documentation. Contributed by Gabor Szadovszky. Project: http://git-wip-us.apache.org/repos/asf/avro/repo Commit: http://git-wip-us.apache.org/repos/asf/avro/commit/58c0aac5 Tree: http://git-wip-us.apache.org/repos/asf/avro/tree/58c0aac5 Diff: http://git-wip-us.apache.org/repos/asf/avro/diff/58c0aac5 Branch: refs/heads/branch-1.8 Commit: 58c0aac536e2ffbf1d1a0ff2f7855f34b036eedb Parents: 97e442c Author: Doug Cutting Authored: Tue Sep 27 07:56:42 2016 -0700 Committer: Ryan Blue Committed: Sat Nov 5 13:18:23 2016 -0700 ---------------------------------------------------------------------- CHANGES.txt | 2 ++ doc/src/content/xdocs/idl.xml | 24 ++++++++++++++++++++ .../java/org/apache/avro/specific/package.html | 6 +++++ 3 files changed, 32 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/avro/blob/58c0aac5/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 7a7e5ef..b9d863b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -26,6 +26,8 @@ Trunk (not yet released) AVRO-1919: Formalize the presence of build.sh. (Suraj Acharya via cutting) + AVRO-1918: Improve logical type documentation. (Gabor Szadovszky via cutting) + BUG FIXES AVRO-1741: Python3: Fix error when codec is not in the header. http://git-wip-us.apache.org/repos/asf/avro/blob/58c0aac5/doc/src/content/xdocs/idl.xml ---------------------------------------------------------------------- diff --git a/doc/src/content/xdocs/idl.xml b/doc/src/content/xdocs/idl.xml index bd74b09..c9a809f 100644 --- a/doc/src/content/xdocs/idl.xml +++ b/doc/src/content/xdocs/idl.xml @@ -206,6 +206,7 @@ error Kaboom {

A type reference in Avro IDL must be one of:

  • A primitive type
  • +
  • A logical type
  • A named schema defined prior to this usage in the same Protocol
  • A complex type (array, map, or union)
@@ -218,6 +219,29 @@ error Kaboom {

+
+ Logical Types +

Some of the logical types supported by Avro's JSON format are also supported by Avro IDL. + The currently supported types are: +

+ +

For example:

+ +record Job { + string jobid; + date submitDate; + time_ms submitTime; + timestamp_ms finishTime; + decimal(9,2) finishRatio; +} + +
+
References to Named Schemata

If a named schema has already been defined in the same Avro IDL file, it may be referenced by name http://git-wip-us.apache.org/repos/asf/avro/blob/58c0aac5/lang/java/avro/src/main/java/org/apache/avro/specific/package.html ---------------------------------------------------------------------- diff --git a/lang/java/avro/src/main/java/org/apache/avro/specific/package.html b/lang/java/avro/src/main/java/org/apache/avro/specific/package.html index d9be484..b331592 100644 --- a/lang/java/avro/src/main/java/org/apache/avro/specific/package.html +++ b/lang/java/avro/src/main/java/org/apache/avro/specific/package.html @@ -31,6 +31,12 @@ Generate specific Java classes for schemas and protocols.

  • Record, enum, and fixed schemas generate Java class definitions.
  • +
  • If a Conversion instance is available for the related logical type, + the value will be mapped to the object returned by that Conversion. The + logical type conversions for {@code date}, {@code time-millis}, {@code + timestamp-millis} and {@code decimal} are pre-defined in the class {@link + org.apache.avro.compiler.specific.SpecificCompiler SpecificCompiler}.
  • +
  • All other types are mapped as in the {@link org.apache.avro.generic generic} API.