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

Sam Pullara commented on AVRO-583:
----------------------------------

Ah, you are right. Was again confusing defining the type name with defining the 
field name.  One breaking change that would probably fix this would be to 
change the "name" field for a field to "field" or something similar.  Then you 
could have:

{"field": "myfield", "type": "record", "name": "myrecord", "fields":[...] }

{"field": "myfield", "type": "array", "items":"string"}

{"field": "myfield", "type": "map", "values":"string"}



> Bad error message if you try and name an array or a map: 
> org.apache.avro.SchemaParseException: Undefined name: "map"
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: AVRO-583
>                 URL: https://issues.apache.org/jira/browse/AVRO-583
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.3.2
>            Reporter: Sam Pullara
>            Priority: Minor
>             Fix For: 1.4.0
>
>
> Error message should be something like "You can't name a map"
> Broken schema:
> {
>   "name":"annoyance",
>   "type":"record",
>   "fields":[
>     {
>       "name":"mymap",
>       "type":"map",
>       "values":"string"
>     }
>   ]
> }
> Error:
> org.apache.avro.SchemaParseException: Undefined name: "map"
>       at org.apache.avro.Schema.parse(Schema.java:876)
>       at org.apache.avro.Schema.parse(Schema.java:912)
>       at org.apache.avro.Schema.parse(Schema.java:796)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to