You can write your own custom store function and return an extension of MultipleOutputFormat in your storage function.
How to write a custom storage function http://pig.apache.org/docs/r0.8.1/udf.html#Store+Functions How to use MultipleOutputFormat http://hadoop.apache.org/docs/r2.2.0/api/org/apache/hadoop/mapred/lib/MultipleOutputFormat.html Also checkout this custom storage function in piggybank http://svn.apache.org/viewvc/pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/MultiStorage.java?view=markup On Mon, Apr 7, 2014 at 4:10 PM, Bharat Bagai <[email protected]>wrote: > Hi > > I have a 1000 text files in which each text file having 800 records and i > want to move that records in 20 csv files. Files creation should be handled > by tool/language itself > > File1.csv have record 2, record 3, record 10, record 11......... > File2.csv have record 4, record 7, record 19, record 11......... > File3.csv have record 5, record 6, record 20, record 11......... > > Now, i am trying to resolve this issue via PIG. But i am struck at first > point, how to create csv with the help of PIG. If any other tool can be > used to resolve above query, I am ready to switch to that tool also but not > JAVA. > > Early help will be appreciated. > > -- Regards, Abhishek Agarwal
