You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Bill Baird (JIRA)" <ji...@apache.org> on 2013/08/15 21:12:49 UTC

[jira] [Updated] (AVRO-1362) Avro schema array cannot reference previously defined record types

     [ https://issues.apache.org/jira/browse/AVRO-1362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bill Baird updated AVRO-1362:
-----------------------------

    Description: 
The following schema compiles successfully in Avro(c#), but in Avro(Java)returns a "Type not supported: Invoice" when parsing the "ListOfInvoices" array.  
Problem appears to be in the parse method.  {"items": "Invoice"} does not properly parse to find the "Invoice" type.

{   "namespace": "SampleClasses",
    "name": "Batch",
    "type": "record",
    "fields": [
		{ "name": "Invoices", "type": {
				"type": "array",
				"items": {
                            "name": "Invoice",
                            "type": "record",
                            "fields": [
                                { "name": "Id", "type": "string" }
                            ]
						}
				}
		},
		{ "name": "SingleInvoice", "type": "Invoice" },            // This reference to "Invoice" works fine.
		{ "name": "ListOfInvoices", "type": {
				"type": "array", "items": {	"type": "Invoice" }    // Fails - does not get previous definition of "Invoice"
			    }
		}
	]
}

  was:
The following schema compiles successfully in Avro(c#), but in Avro(Java)returns a "Type not supported: Invoice" when parsing the "ListOfInvoices" array.  Problem appears to be in the parse method.  {"items": "Invoice"} does not properly parse to find the "Invoice" type.

{   "namespace": "SampleClasses",
    "name": "Batch",
    "type": "record",
    "fields": [
		{ "name": "Invoices", "type": {
				"type": "array",
				"items": {
                            "name": "Invoice",
                            "type": "record",
                            "fields": [
                                { "name": "Id", "type": "string" }
                            ]
						}
				}
		},
		{ "name": "SingleInvoice", "type": "Invoice" },            // This reference to "Invoice" works fine.
		{ "name": "ListOfInvoices", "type": {
				"type": "array", "items": {	"type": "Invoice" }    // Fails - does not get previous definition of "Invoice"
			    }
		}
	]
}

    
> Avro schema array cannot reference previously defined record types
> ------------------------------------------------------------------
>
>                 Key: AVRO-1362
>                 URL: https://issues.apache.org/jira/browse/AVRO-1362
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.4
>         Environment: Schema class - org.apache.avro:avro:1.7.4
> Also confirmed in Avro 1.7.5 (RC)
>            Reporter: Bill Baird
>
> The following schema compiles successfully in Avro(c#), but in Avro(Java)returns a "Type not supported: Invoice" when parsing the "ListOfInvoices" array.  
> Problem appears to be in the parse method.  {"items": "Invoice"} does not properly parse to find the "Invoice" type.
> {   "namespace": "SampleClasses",
>     "name": "Batch",
>     "type": "record",
>     "fields": [
> 		{ "name": "Invoices", "type": {
> 				"type": "array",
> 				"items": {
>                             "name": "Invoice",
>                             "type": "record",
>                             "fields": [
>                                 { "name": "Id", "type": "string" }
>                             ]
> 						}
> 				}
> 		},
> 		{ "name": "SingleInvoice", "type": "Invoice" },            // This reference to "Invoice" works fine.
> 		{ "name": "ListOfInvoices", "type": {
> 				"type": "array", "items": {	"type": "Invoice" }    // Fails - does not get previous definition of "Invoice"
> 			    }
> 		}
> 	]
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira