Hello Hortonworks Community,
I run the Hortonworks Sandbox and i have problems with Xpath.
I loaded this simple xml-File into the HDFS and then in a single column table.
<?xml version=’1.0′ encoding=’UTF-8′?><digifoto><tracker uuid=’0000000f-8d3c-2a4b-3764-55ac3ffdeab1′></tracker></digifoto>
The type of the table column is string.
Aftter that i tried to parse the xml via Xpath with this statement:
SELECT xpath(xmltabletest.xmltestfield,’//@uuid’) FROM xmltabletest;
But this statement returns the following error message:
{“message”:”H170 Unable to fetch results. java.io.IOException: org.apache.hadoop.hive.ql.metadata.HiveException: Error evaluating array (‘xmltestfield’,”//@uuid”) [ERROR_STATUS]”,”status”:500,”trace”:”org.apache.ambari.view.hive.client.HiveErrorStatusException: H170 Unable to fetch results. java.io.IOException: org.apache.hadoop.hive.ql.metadata.HiveException: Error evaluating array (‘xmltestfield’,”//@uuid”) [ERROR_STATUS]\n\norg.apache.ambari.view.hive.client.HiveErrorStatusException: H170 Unable to fetch results. java.io.IOException: org.apache.hadoop.hive.ql.metadata.HiveException: Error evaluating array (‘xmltestfield’,”//@uuid”) [ERROR_STATUS]\n\tat org.apache.ambari.view.hive.client.Utils.verifySuccess(Utils.java:29)\n\tat org.apache.ambari.view.hive.client.Cursor.fetchNextBlock(Cursor.java:82)\n\tat org.apache.ambari.view.hive.client.Cursor.fetchIfNeeded(Cursor.java:169)\n\tat org.apache.ambari.view.hive.client.Cursor.hasNext(Cursor.java:162)\n\tat org.apache.ambari.view.hive.client.Cursor.readRaw(Cursor.java:224)\n\tat org.apache.ambari.view.hive.resources.jobs.ResultsPaginationController.request(ResultsPaginationController.java:129)\n\tat org.apache.ambari.view.hive.resources.jobs.JobService.getResults(JobService.java:279)\n\tat sun.reflect.GeneratedMethodAccessor333.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:606)\n\tat com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)\n\tat
…
When i replace the column with the xml it still works like this:
SELECT xpath(“<?xml version=’1.0′ encoding=’UTF-8′?><digifoto><tracker uuid=’0000000f-8d3c-2a4b-3764-55ac3ffdeab1′></tracker></digifoto>”,’//@uuid’) FROM xmltabletest;
Can you help me?
Thanks