Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Pig job creating right justified file with FixedWidthStorer. I want to create left justified file.

Highlighted

Pig job creating right justified file with FixedWidthStorer. I want to create left justified file.

New Contributor

I am on HDP 2.3.4. Below is pig script

A = LOAD '/user/n0276082/tmp/file2.txt' USING PigStorage(',') AS (c1:chararray,c2:chararray, c3:chararray , c4:chararray); STORE A INTO '/user/n0276082/HH/matchFile' USING org.apache.pig.piggybank.storage.FixedWidthStorer('1-30, 31-61, 62-92, 93-110' ,'NO_HEADER' );

file2.txt looke like this:

1234,acdb,dwdw,123

2121,dsds,fefe,5454

21134,dwdwwd,erer,4343

File get created at /user/n0276082/HH/matchFile/part-m-00000 is attached.part-m-00000.txt

I want to store the data in left justified.

Please let me know if there is way to do that.

1 REPLY 1

Re: Pig job creating right justified file with FixedWidthStorer. I want to create left justified file.

@Dinesh Dhiman

By default, 'FixedWidthStorer' aligns the value right-justified and this is not a bug. However, if you want the values to be left-justified then customer's have to request Hortonworks support to provide the updated jar file.

Support: You can refer this internal link

Don't have an account?
Coming from Hortonworks? Activate your account here