You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Doug Cutting <cu...@apache.org> on 2012/06/01 02:05:39 UTC

Re: Specific compiler task, separate schemas

On 05/30/2012 06:04 PM, Mark Hayes wrote:
> I found a way around this.  If I put all three schemas in a single JSON
> array, in a single JSON document in a file, and parse that file using
> the ant SchemaTask, then it works -- it generates classes for all three
> schemas.  I assume it will also work when parsing the schema using other
> tools.
>
> I don't see this documented anywhere and I found it by trial and error.
>   My guess is that the top level array is treated as an Avro union, and
> the SpecificCompiler doesn't happen to output this top level union type.

That's right.

> I don't know if it is meant to work this way (i.e, will continue to work
> in the future), or is just a coincidence.  Does anyone know?

This will continue to work in the future.  Other folks rely on it.

The Ant task might be improved to make this easier.  If the task reused 
the SpecificCompiler instance then one might be able to specify the 
compiler input as something like:

<fileset>
   <filename name="T1.avsc"/>
   <filename name="T2DependsonT1"/>
</fileset>

If this sounds useful to you, please file an issue in Jira.

Doug

Re: Specific compiler task, separate schemas

Posted by Mark Hayes <ma...@greybird.com>.
On Thu, May 31, 2012 at 5:05 PM, Doug Cutting <cu...@apache.org> wrote:

> This will continue to work in the future.  Other folks rely on it.
>

Thank you Doug, it helps a lot to know that.


> The Ant task might be improved to make this easier.  If the task reused
> the SpecificCompiler instance then one might be able to specify the
> compiler input as something like:
>
> <fileset>
>  <filename name="T1.avsc"/>
>  <filename name="T2DependsonT1"/>
> </fileset>
>
> If this sounds useful to you, please file an issue in Jira.


It does seem useful, and also a natural enhancement, so I filed this Jira
issue:
https://issues.apache.org/jira/browse/AVRO-1107

Thanks again,
--mark