1
votes

In pig while using Load data flow step what is difference with using (Using PigStorage) and with out using it?

want to know the difference between below steps.

movie2 = load 'movie/part-m-00000' as (mid:int, mname:chararray, myr:int);

movie2 = load 'movie/part-m-00000' using PigStorage(',') as (mid:int, mname:chararray, myr:int);
2

2 Answers

0
votes

The default is to use PigStorage, which is a textfile in which fields are separated by a delimeter, with the tab character as the delimeter.

Specifying using PigStorage(',') changes the delimeter to a comma.

0
votes

Adding to answer of rsp, there are 2 advantages of using PigStorage

  1. Option to specify the file delimiter

  2. Option to load the schema of the input or not.

More details here: http://pig.apache.org/docs/r0.10.0/api/org/apache/pig/builtin/PigStorage.html