Support Questions
Find answers, ask questions, and share your expertise

Getting Empty output for XML file in Pig

Getting Empty output for XML file in Pig

i am trying to import XML file in pig

A = LOAD'/home/pig.xml' USING org.apache.pig.piggybank.storage.XMLLoader('property') AS (M:CHARARRAY);

B = FOREACH A GENERATE FLATTEN(REGEX_EXTRACT_ALL(M,'<property>\\s*<name>(.*)</name>\\s*<value>(.*)</value>\\s*<description>(.*)</description>\\s*</property>'));

DUMP B;

Here my XML File

<configuration>

<property>

<name>client.location</name>

<value></value>

<description>Must be specified. </description>

</property>

</configuration>

I am getting empty bag as output...Please help.

1 REPLY 1

Re: Getting Empty output for XML file in Pig

Kindly note,I can not run XPath() as i am working on pig 0.11.1