You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Paul Mazak (JIRA)" <ji...@apache.org> on 2015/06/09 22:56:01 UTC

[jira] [Updated] (PIG-4570) Allow AvroStorage to use a class for the schema

     [ https://issues.apache.org/jira/browse/PIG-4570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Mazak updated PIG-4570:
----------------------------
    Attachment: PIG-4570_2.patch

Ok. Added a test case to TestAvroStorage, along with RecordPojo.avsc and RecordPojo.java.  The test specifies the "-c org.apache.pig.builtin.avro.code.java.RecordPojo" arg.  The class was generated by avro-tools and checked into the test code base.
{quote}
java -jar avro-tools.jar 
compile schema test\org\apache\pig\builtin\avro\schema\RecordPojo.avsc test
{quote}

> Allow AvroStorage to use a class for the schema
> -----------------------------------------------
>
>                 Key: PIG-4570
>                 URL: https://issues.apache.org/jira/browse/PIG-4570
>             Project: Pig
>          Issue Type: New Feature
>    Affects Versions: 0.14.0
>            Reporter: Paul Mazak
>            Assignee: Paul Mazak
>            Priority: Minor
>         Attachments: PIG-4570.patch, PIG-4570_2.patch
>
>
> When you are managing Avro Schemas in your source code and you have the Java classes to serialize/deserialize Avro, it would be easier to do something like:
> {quote}
> store a into 'tmp/myuser' using AvroStorage(null, '-schemaclass com.myco.MyUser')
> {quote}
> Rather than passing as the first agurment, the entire Avro schema json in the pig script, or keeping a (potentially outdated) set of Avro schema files in HDFS for the -schemafile option.
> If your classpath is already aware of how to serialize/deserialize the Avro data, it would be good to leverage that with a fully qualified classname.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)