Greetings.

For testing purposes I need to create a relation in a Pig script.
I found 2 questions about this in StackOverflow:

http://stackoverflow.com/questions/13414172/how-to-create-a-small-constant-relationtable-in-pig
http://stackoverflow.com/questions/12423399/define-tuple-datas-in-the-pig-script

Is there anything about this?

Resuming, there are 4 possible solutions:

- Load from a file with the data
- Load an empty file and set data with foreach-generate
- Load from a special loader (ConstantLoader?)
- Add to Pig Latin the construction "A = value".

I find the solution 1 right, but much hassle to load only 1 tuple.
I find the solution 2 quite dirty.
I find the solution 3 factible.
I find the solution 4 factible but more work than solution 3.

Another point is that solution 3 is better than solution 1 when it is only
for 1 or 2 tuples because that tuple can be created based on parameteres to
the script.

I did not find an issue related in jira. Does anyone know about?

I can develop solution 3, but before creating any issue I think the best
thing is to ask here :)

Thanks,

Alfonso Nishikawa

Reply via email to