Yes, you can reference an Avro schema file in HDFS with the "schema_file" param. See TestAvroStorage.testRecordWithFieldSchemaFromTextWithSchemaFile here for an example:
http://svn.apache.org/repos/asf/pig/trunk/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/storage/avro/TestAvroStorage.java On Tue, Dec 13, 2011 at 2:49 AM, IGZ Nick <[email protected]> wrote: > Hi all, > > I want to keep the pig script and storage schema separate. Is it possible > to do this in a clean way? THe only way that has worked so far is to do > like: > AvroStorage('schema', > > '{"name":"xyz","type":"record","fields":[{"name":"abc","type":"string"}]}'); > > That too, all the schema in one line. If I split it onto multiple lines, I > get a MismatchException (93-3) or something like that. Is there no way to > do AvroStorage('file', <hdfs path of schema file>) or something of that > sort, or at least be able to specify the schema in multiple lines? > > Thanks, >
