avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-2003) Report specific location of schema incompatibilities
Date Fri, 03 Mar 2017 11:05:45 GMT

    [ https://issues.apache.org/jira/browse/AVRO-2003?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15894154#comment-15894154
] 

ASF GitHub Bot commented on AVRO-2003:
--------------------------------------

GitHub user teabot opened a pull request:

    https://github.com/apache/avro/pull/201

    AVRO-2003: Report specific location of schema incompatibilities

    Includes patch [AVRO-1933](https://issues.apache.org/jira/browse/AVRO-1933) whose PR is
located here: #200 
    
    JIRA: [AVRO-2003](https://issues.apache.org/jira/browse/AVRO-2003)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/HotelsDotCom/avro AVRO-2003

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/avro/pull/201.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #201
    
----
commit f9bf0308fbb83f25b9e87f10f0ab16dfae93e845
Author: Anders Sundelin <anders.sundelin@ericsson.com>
Date:   2017-03-02T10:12:03Z

    AVRO-1933: Add more specific error details to SchemaCompatibility class

commit 7015f9f71ebc789129e8811c9c43ba103be0bf68
Author: Elliot West <ewest@hotels.com>
Date:   2017-03-03T10:58:48Z

    Track location of incompatibility using a JSON Pointer.
    Additional test cases for nested incompatibility locations.
    msg -> message
    details -> result

----


> 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.3.15#6346)

Mime
View raw message