PigStorage interpreting chararray/bytearray for a tuple element inside a bag as 
float or double

                 Key: PIG-1031
                 URL: https://issues.apache.org/jira/browse/PIG-1031
             Project: Pig
          Issue Type: Bug
          Components: impl
    Affects Versions: 0.5.0
            Reporter: Viraj Bhat
             Fix For: 0.5.0, 0.6.0

I have a data stored in a text file as:


I try reading it using PigStorage as:
A = load 'pigstoragebroken.dat' using PigStorage() as 
dump A;

I get the following results:


The problem seems to be with the method: parseFromBytes(byte[] b) in class 
Utf8StorageConverter. This method uses the TextDataParser (class generated via 
jjt) to interpret the type of data from content, even though the schema tells 
it is a bytearray. 

TextDataParser.jjt  sample code
 < DOUBLENUMBER: (["-","+"])? <FLOATINGPOINT> ( ["e","E"] ([ "-","+"])? 

I tried the following options, but it will not work as we need to call 
bytesToBag(byte[] b) in the Utf8StorageConverter class.
A = load 'pigstoragebroken.dat' using PigStorage() as 
A = load 'pigstoragebroken.dat' using PigStorage() as 


This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

Reply via email to