- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
org.apache.pig.piggybank.evaluation.xml.XPath
- Labels:
-
Apache Pig
-
Cloudera Hue
Created on 06-24-2016 01:44 PM - edited 09-16-2022 03:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm creating a PIG query running on Hue.
The first part of my query does run:
REGISTER piggybank.jar
A = LOAD '/durocan/staging/installationconfigs/InstallationConfigExample.xml' using org.apache.pig.piggybank.storage.XMLLoader('Installation') as (x:chararray);
The second part fails:
B = FOREACH A GENERATE org.apache.pig.piggybank.evaluation.xml.XPath(x, 'Installation/Durocan/Sensors/Sensor/Name');
dump B;
Error:
Could not resolve org.apache.pig.piggybank.evaluation.xml.XPath
How is it possible that org.apache.pig.piggybank.storage.XMLLoader get's resolved and org.apache.pig.piggybank.evaluation.xml.XPath is not?
Created 06-24-2016 03:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fixed it 🙂
It seems that the Cloudera deployment of the Piggybank.jar does not containt the xpath functionality
(or any xml functionality at all).
I downloaded piggybank.jar 0.15.0 from https://mvnrepository.com/artifact/org.apache.pig/piggybank/0.15.0
put it in /home/ubuntu and used it in my script.
REGISTER /home/ubuntu/piggybank-0.15.0.jar A = LOAD '/MyPath/Example.xml' using org.apache.pig.piggybank.storage.XMLLoader('RootNode') as (xmlContents:chararray); B= FOREACH A GENERATE org.apache.pig.piggybank.evaluation.xml.XPath(xmlContents, 'MyXpathQuery'); STORE B INTO 'Output/B' USING PigStorage();
Now everything works fine! 🙂
Created 06-24-2016 03:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fixed it 🙂
It seems that the Cloudera deployment of the Piggybank.jar does not containt the xpath functionality
(or any xml functionality at all).
I downloaded piggybank.jar 0.15.0 from https://mvnrepository.com/artifact/org.apache.pig/piggybank/0.15.0
put it in /home/ubuntu and used it in my script.
REGISTER /home/ubuntu/piggybank-0.15.0.jar A = LOAD '/MyPath/Example.xml' using org.apache.pig.piggybank.storage.XMLLoader('RootNode') as (xmlContents:chararray); B= FOREACH A GENERATE org.apache.pig.piggybank.evaluation.xml.XPath(xmlContents, 'MyXpathQuery'); STORE B INTO 'Output/B' USING PigStorage();
Now everything works fine! 🙂
