PigStorage (the default load and store function) does not handle this case. You would need to write you own load function. Using PigStorage as a model this should not be too difficult. Instead of looking for field separators you just parse out the fields based on length, and then use standard string functions to trim the white space.

Alan.

On Apr 6, 2011, at 11:15 AM, Shantian Purkad wrote:

Any ideas on this?



________________________________
From: Shantian Purkad <[email protected]>
To: [email protected]
Sent: Mon, April 4, 2011 11:19:14 PM
Subject: Processing fixed length records with Pig


Hi,

I have a file which has records having fixed length fields (and spaces appended
to fill the field length)

How can I load these records using Pig specifying field lengths and also auto
trimming extra spaces.


Thanks and Regards,
Shantian

Reply via email to