avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Carey <scottca...@apache.org>
Subject Re: Compiling multiple input schemas
Date Tue, 16 Aug 2011 21:52:30 GMT
What about leveraging shell expansion?
This would mean we would need inverse syntax, like tar or zip ( destination,
list of sources in reverse dependency order )

Then your examples are
avro-tools-1.6.0.jar compile schema tmp/ input/position.avsc
input/player.avsc
avro-tools-1.6.0.jar compile schema tmp/ input/*

That would be incompatible, since we reversed argument order.  But it would
be more like other unix command line tools that take lists of files and
output results somewhere else.

(Or as I see Doug has just replied ‹ the last argument can be the
destination)

On 8/16/11 1:38 PM, "Bill Graham" <billgraham@gmail.com> wrote:

> Hi,
> 
> With Avro-874, multiple inter-dependent schema files can be parsed. I've
> written a patch to the SpecificCompilerTool to allow the same when producing
> java from multiple schemas that I'd like to contribute for consistency if
> there's interest. It allows you to pass multiple input files like this:
> 
> $ java -cp avro-tools-1.6.0.jar org.apache.avro.tool.Main compile schema
> input/position.avsc,input/player.avsc tmp/
> 
> While I was at it, it seemed useful to parse an entire directory of schema
> files as well so I implemented this:
> 
> $ java -cp avro-tools-1.6.0.jar org.apache.avro.tool.Main compile schema
> input/ tmp/
> 
> The latter approach will not work properly for files with dependencies, since
> the file order probably isn't in reverse dependency order. If that's the case,
> a combination of files and directories can be used to force an ordering. So if
> b depends on a and other files depend on either of them you could do this:
> 
> $ java -cp avro-tools-1.6.0.jar org.apache.avro.tool.Main compile schema
> input/a.avsc,input/b.avsc,input/ tmp/
> 
> Let me know if some or all of this seems useful to contribute. The first
> example is really the main one that I need. I've done the same for Protocol as
> well btw.
> 
> thanks,
> Bill



Mime
View raw message