Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
I'm having issues with loading the XML using Piggybank's XMLLoader.
The XML does not load correctly when the XML has a child element starting with the same name as the parent (See the Person tag and Person_ID tag).
<Person>
<FirstName>John</FirstName>
<MiddleName/>
<LastName>Lennon</LastName>
<Person_ID>JL</Person_ID>
<Address>
<Street1>1 New Street</Street1>
<Street2/>
<City>New town</City>
<State>New State</State>
<Zip>00001</Zip>
</Address>
</Person>
A = LOAD 'test.xml' USING org.apache.pig.piggybank.storage.XMLLoader ('Person') AS(x:chararray);
DUMP a;
OUTPUT
(<Person_ID/>)
However the XML loads correctly when the child tag doesn't start with the parent tag's name
<Person>
<FirstName>John</FirstName>
<MiddleName/>
<LastName>Lennon</LastName>
<ID_Person>JL</ID_Person>
<Address>
<Street1>1 New Street</Street1>
<Street2/>
<City>New town</City>
<State>New State</State>
<Zip>00001</Zip>
</Address>
</Person>
A = LOAD 'test.xml' USING org.apache.pig.piggybank.storage.XMLLoader ('Person') AS(x:chararray);
DUMP a;
OUTPUT
(<Person> <FirstName>John</FirstName> <MiddleName/> <LastName>Lennon</LastName> <ID_Person>JL<ID_Person/> <Address> <Street1>1 New Street</Street1> <Street2/> <City>New town</City> <State>New State</State> <Zip>00001</Zip> </Address> </Person>)