You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Dan Harvey <da...@mendeley.com> on 2011/01/31 19:47:30 UTC

StoreFunc Schema

Hey,

I'm just porting a json StoreFunc class method I wrote from pig 0.6 to pig
0.8 so I can take advantage of the schema that the Store's can use from 0.7
onwards.
I'm overloaded the method to get the chema when the saving starts but am
finding the ResourceSchema object being sent is always null so I'm not able
to use it.

I've put a few samples of this online so you can see here
https://gist.github.com/804551 (I'll be open sourcing all of this once I'm
done)

I'm testing this out with the following Pig Code.

A = LOAD "test" AS (a:chararray, b:chararray);

STORE A USING ... JsonStorage();

Is this correct or is there another way to get the schema for the StoreFunc?

Thanks,

-- 
Dan Harvey | Datamining Engineer
www.mendeley.com/profiles/dan-harvey

Mendeley Limited | London, UK | www.mendeley.com
Registered in England and Wales | Company Number 6419015

Re: StoreFunc Schema

Posted by Daniel Dai <ji...@yahoo-inc.com>.
Looks like you should be able to get ResourceSchema in checkSchema, as 
long as the schema for the alias is not null.

Daniel

Dan Harvey wrote:
> Hey,
>
> I'm just porting a json StoreFunc class method I wrote from pig 0.6 to pig
> 0.8 so I can take advantage of the schema that the Store's can use from 0.7
> onwards.
> I'm overloaded the method to get the chema when the saving starts but am
> finding the ResourceSchema object being sent is always null so I'm not able
> to use it.
>
> I've put a few samples of this online so you can see here
> https://gist.github.com/804551 (I'll be open sourcing all of this once I'm
> done)
>
> I'm testing this out with the following Pig Code.
>
> A = LOAD "test" AS (a:chararray, b:chararray);
>
> STORE A USING ... JsonStorage();
>
> Is this correct or is there another way to get the schema for the StoreFunc?
>
> Thanks,
>
>