The schema provided is a union of several schemas. Java supports parsingthis, C++ may not. Does it work if you make it one single schema, andnest "NA", "acomplex" and "retypes" inside of "object" ? It only needs tobe defined the first time it is referenced. If it does not, then it iscertainly a bug.

Either way I would file a bug in JIRA. The spec does not say whether afile should be parseable if it contains a union rather than a record, butit probably should be.

-Scott

On 6/24/12 11:17 PM, "Saptarshi Guha" <[EMAIL PROTECTED]> wrote:

>I have a avro scheme found here: http://sguha.pastebin.mozilla.org/1677671>>I tried>>java -jar avro-tools-1.7.0.jar compile schema ~/tmp/robject.avro foo>>and it worked.>>This failed:>>avrogencpp --input ~/tmp/robject.avro --output ~/tmp/h2>Segmentation fault: 11>>>This failed:>> avro_schema_t *person_schema >(avro_schema_t*)malloc(sizeof(avro_schema_t));>(avro_schema_from_json_literal(string.of.avro.file), person_schema)>>with>>Error was Error parsing JSON: string or '}' expected near end of file>>Q1: Does C and C++ API support all schemas the Java one supports?>Q2: Is it yes to Q1 and this is a bug?>>Regards>Saptarshi

Here 'attrytpe' is a Map type defined elsewhere and "myrtype" is an enum defined elsewhere.Similarly for a complex one in the union, it's 'values' field will be an array of "complex type" defined elsewhere?Woud i need multiple avro files using the same namespace?

The schema provided is a union of several schemas. Java supports parsingthis, C++ may not. Does it work if you make it one single schema, andnest "NA", "acomplex" and "retypes" inside of "object" ? It only needs tobe defined the first time it is referenced. If it does not, then it iscertainly a bug.

Either way I would file a bug in JIRA. The spec does not say whether afile should be parseable if it contains a union rather than a record, butit probably should be.

a) I need Java and C - because the messages will be consumed by Java and Cb) I'd rather stay away from C++ because of the Boost dependency - nothing against itjust becomes another installation hurdlec) I need to check with other languages e.g. Python since i look forward to language interop.

Here 'attrytpe' is a Map type defined elsewhere and "myrtype" is an enum defined elsewhere.Similarly for a complex one in the union, it's 'values' field will be an array of "complex type" defined elsewhere?Woud i need multiple avro files using the same namespace?

The schema provided is a union of several schemas. Java supports parsingthis, C++ may not. Does it work if you make it one single schema, andnest "NA", "acomplex" and "retypes" inside of "object" ? It only needs tobe defined the first time it is referenced. If it does not, then it iscertainly a bug.

Either way I would file a bug in JIRA. The spec does not say whether afile should be parseable if it contains a union rather than a record, butit probably should be.

> 3. C> > avro_schema_t *person_schema = (avro_schema_t*)malloc(sizeof(avro_schema_t));> (avro_schema_from_json_literal(jsonstring, person_schema)) > > returns:> > Error was Error parsing JSON: string or '}' expected near end of file> > So is this a bug? or am i calling it wrong.

That error message is from the JSON parser we use internally — it claims that there's a syntax error in the JSON that you've passed in. Can you send us the snippet where you define jsonstring? It might be an issue of escaping things correctly in the C string literal. Also, there's a comment where avro_schema_from_json_literal is defined, saying that jsonstring must be defined as a "char[]" and not a "char *". And of course it could also be an actual syntax error. :-)

–doug

NEW: Monitor These Apps!

All projects made searchable here are trademarks of the Apache Software Foundation.
Service operated by Sematext