Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Avro >> mail # user >> Correct avsc definition for array of external object's


Copy link to this message
-
Correct avsc definition for array of external object's
Hi Folks,
I am modeling the following Java as JSON in my avsc

/* list of {@link ExtractorSpec}s associated with this product type */
private List<ExtractorSpec> extractors = null;

...
            {
              "name": "extractors",
              "type": {
                "type": "array",
                "items": "ExtractorSpec"
              },
              "doc": "A list of ExtractorSpecs associated with this product
type.",
              "default": null
            },
...

When I am compiling, as expected I am getting
./bin/gora goracompiler Product.avsc .
Exception in thread "main" org.apache.avro.SchemaParseException: Undefined
name: "ExtractorSpec".

The question I am asking is whether I should embed the ExtractorSpec as a
nested record? Or is there another way such as importing?
I've read a coule of threads [0] relating to IDL but this is not too
appealing as I *just* want my .avsc in JSON. I am trying to keeping things
as easy as possible for users.
I am using Avro 1.7.5 here.
Thank you very much in advance for any feedback.
Lewis

[0] http://www.mail-archive.com/[EMAIL PROTECTED]/msg00799.html

--
*Lewis*
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB