1
我是新手在豬上工作。我曾經遇到過一個問題在處理XML文件,下面的命令我用什麼:無法在豬中處理Xml
register '/usr/lib/pig-0.12.0/contrib/piggybank/java/piggybank.jar'
pigdata = load '/xml1.xml' using org.apache.pig.piggybank.storage.XMLLoader('name') as (doc:chararray);
values = foreach pigdata GENERATE FLATTEN(REGEX_EXTRACT_ALL(doc,'<name>(.*)</name>')) AS (name:chararray);
dump values;