I have a txt file of fixed length:
ABCDEFGHIJ0000100002
I have the following code:
D = LOAD ‘/user/us059919/testfile2.txt’ USING PigStorage() AS (row:chararray);
E = FOREACH D GENERATE SUBSTRING(row,0,20) as one,
SUBSTRING(row,10,5) as value1,
SUBSTRING(row,15,5) as value2;
DESCRIBE E;
DUMP E;
The output displayed is:
(ABCDEFGHIJ0000100002,,,)
The question is that it’s not parsing the values for “value1″ (position 10 for length 5) and “value2″ (position 15 for length 5) – input file position 1 is PIG posn 0.
Both these are displayed as null.
Could anyone explain why please?
Thanks.
Soyab