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 41C27200D53 for ; Tue, 5 Dec 2017 10:02:09 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4034D160C1B; Tue, 5 Dec 2017 09:02:09 +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 86488160C0A for ; Tue, 5 Dec 2017 10:02:08 +0100 (CET) Received: (qmail 64204 invoked by uid 500); 5 Dec 2017 09:02:07 -0000 Mailing-List: contact dev-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 dev@avro.apache.org Received: (qmail 64193 invoked by uid 99); 5 Dec 2017 09:02:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Dec 2017 09:02:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id D1CEFC40BC for ; Tue, 5 Dec 2017 09:02:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.011 X-Spam-Level: X-Spam-Status: No, score=-100.011 tagged_above=-999 required=6.31 tests=[SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 7kM5eFvo8E_f for ; Tue, 5 Dec 2017 09:02:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id EDF3F5F2C4 for ; Tue, 5 Dec 2017 09:02:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D8C0AE20C5 for ; Tue, 5 Dec 2017 09:02:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 25E69255CB for ; Tue, 5 Dec 2017 09:02:00 +0000 (UTC) Date: Tue, 5 Dec 2017 09:02:00 +0000 (UTC) From: "Nandor Kollar (JIRA)" To: dev@avro.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AVRO-2003) Report specific location of schema incompatibilities MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 05 Dec 2017 09:02:09 -0000 [ https://issues.apache.org/jira/browse/AVRO-2003?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nandor Kollar updated AVRO-2003: -------------------------------- Resolution: Fixed Hadoop Flags: Incompatible change Release Note: SchemaCompatibility reports location of incompatibility as a JSON Pointer. This is a backward incompatible change, because the public interface of SchemaCompatibility class changed. (was: SchemaCompatibility reports location of incompatibility as a JSON Pointer.) Status: Resolved (was: Patch Available) > Report specific location of schema incompatibilities > ---------------------------------------------------- > > Key: AVRO-2003 > URL: https://issues.apache.org/jira/browse/AVRO-2003 > Project: Avro > Issue Type: Improvement > Components: java > Affects Versions: 1.8.1 > Environment: Any java env > Reporter: Elliot West > Assignee: Elliot West > Priority: Minor > Fix For: 1.9.0 > > Attachments: AVRO-2003.patch > > > h2. Overview > Building on the work to improve schema incompatibility reporting in AVRO-1933, it would be useful if the {{SchemaCompatibility}} classes could also report the location in the schema where any incompatibility was encountered. > It is recommended that the location reported is both easily readable by humans and machines. In the first case this would assist schema developers to pin-point issues in there schema documents, and in the latter case it provides a useful mechanism to schema tooling, such as IDEs and editors, to easily select the pertinent nodes in the Schema document tree. > h2. Implementation specifics > To meet this requirements it is suggested that the location is encoded using the [JSON Pointer specification|https://tools.ietf.org/html/rfc6901]. This is both easily parsed by users, but is also supported by a number of libraries for a range of common programming languages and platforms. > h2. Examples > Given the following example schema, consider some incompatibility scenarios. For each case an expected JSON Pointer description of the incompatibility location is described: > {code} > { > "type": "record", > "name": "myRecord", > "fields" : [ > {"name": "pField", "type": "long"}, > {"name": "uField", "type": > ["null", "int", "string"] > }, > {"name": "eField", "type": > { "type": "enum", "name": "Suit", "symbols" : ["SPADES", "HEARTS", "DIAMONDS", "CLUBS"] } > }, > {"name": "aField", "type": > {"type": "array", "items": "string"} > }, > {"name": "mField", "type": > {"type": "map", "values": "long"} > }, > {"name": "fField", "type": > {"type": "fixed", "size": 16, "name": "md5"} > } > ] > } > {code} > Possible incompatibility scenarions and the location that would be reported back to the user/tool: > * Root type incompatibility; report location: {{/}} > * Record name mismatch; report location: {{/name}} > * {{pField}} type incompatibility; report location: {{/fields/0/type}} > * {{uField}} field type incompatibility; report location: {{/fields/1/type}} > * {{uField}} missing union branch {{string}}; report location: {{/fields/1/type/2}} > * {{eField}} field type incompatibility; report location: {{/fields/2/type}} > * {{eField}} missing enum symbol; report location: {{/fields/2/type/symbols}} > * {{eField}} enum name mismatch; report location: {{/fields/2/type/name}} > * {{aField}} field type incompatibility; report location: {{/fields/3/type}} > * {{aField}} array element type incompatibility; report location: {{/fields/3/type/items}} > * {{mField}} field type incompatibility; report location: {{/fields/4/type}} > * {{mField}} map value type incompatibility; report location: {{/fields/4/type/values}} > * {{fField}} field type incompatibility; report location: {{/fields/5/type}} > * {{fField}} fixed name mismatch; report location: {{/fields/5/type/name}} > * {{fField}} fixed size type incompatibility; report location: {{/fields/5/type/size}} > * {{fField}} missing default value; report location: {{/fields/5}} > h2. Notes > * This ticket depends on AVRO-1933 and associated patches. -- This message was sent by Atlassian JIRA (v6.4.14#64029)