You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "peter liu (JIRA)" <ji...@apache.org> on 2015/06/30 18:49:04 UTC

[jira] [Commented] (AVRO-1256) C++ API compileJsonSchema ignores "doc" and custom attributes on a field/record

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

peter liu commented on AVRO-1256:
---------------------------------

thanks for the patch, [~pidefrem]. This is exactly what we are looking for. 2 requests here:

* could you please add unit tests in the patch file?
* I tested your patch a little bit with the schema in the description, and it seems only record level doc is supported but doesn't work for field level doc. can you please take a look?

Thanks,
-Peter

> C++ API compileJsonSchema ignores "doc" and custom attributes on a field/record
> -------------------------------------------------------------------------------
>
>                 Key: AVRO-1256
>                 URL: https://issues.apache.org/jira/browse/AVRO-1256
>             Project: Avro
>          Issue Type: Improvement
>          Components: c++
>    Affects Versions: 1.7.2
>         Environment: Running on all platforms (Windows, OSX, Linux)
>            Reporter: Tim Menninger
>            Priority: Minor
>         Attachments: AVRO-1256.patch
>
>
> It appears that when my JSON is compiled into a valid schema object it is ignoring all types of "documentation" that I am trying to adorn with each field in my record. Reading through the Java issues it seems that this was a bug and fixed (AVRO-601, AVRO-612, AVRO-779) but it seems the C++ implementation has yet to adopt this feature? This is my sample schema, I have attempted to insert both "doc" and "mycustom" in multiple places to see if it is supported at any level. Please excuse if there appears to be a syntax error in the JSON I hand tweaked some of this. The schema is valid and successfully parses.
> {
> 	"type": "record",
> 	"name": "myschema",
> 	"doc": "Doc Meta",
> 	"mycustom": "My Custom",
> 	"fields": [
> 		{ "name":"field_a","type":["string","null"], "doc":"Doc Meta", "mycustom":"My Custom A"},
> 		{ "name":"field_b","type":["string","null"], "doc":"Doc Meta", "mycustom":"My Custom B"},
> 		{ "name":"field_c","type":["string","null"], "doc":"Doc Meta", "mycustom":"My Custom C"}
>    	]
> }
> I looked through the SchemaTests.cc code for 1.7.3 and there was not a test case for this there so i didn't think this was addressed in that version. I am running 1.7.2. When this schema is used to load with compileJsonSchema and then a file is serialized the file schema looks like this.
> {
> 	"type":"record",
> 	"name":"myschema",
> 	"fields": [
> 		{ "name":"field_a","type":["string","null"]},
> 		{ "name":"field_b","type":["string","null"]},
> 		{ "name":"field_c","type":["string","null"]}
>    	]
> }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)