Reputation: 93
I am a newbie to Pig. I am trying to figure out how to define a bag or tuple with hard coded values, without loading data from a file. Every example that I have encountered with starts with:
a = LOAD '/file/name' using PigStorage(',');
or something similar. I just want to create a tuple or bag like this:
a = <1,2,3>;
Is it possible to use hard coded values for testing purposes?
Thanks.
Upvotes: 9
Views: 812
Reputation: 456
Unfortunately it is impossible to just create a tuple or bag in Pig like this in the current version (0.15.0).
My suggestion is to create a simple text file with a few values separated by commas, and use the following command:
a = LOAD '/path' using PigStorage(',');
The text file should look something like:
1,2,3
Hopefully in future versions they will release some way to accomplish creating a tuple or bag with a single command.
Good Luck practicing Pig!
Upvotes: 3