I\'m trying to load XML data into Hive but I\'m getting an error :
java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runt
then follow the below steps to get the solution as like as you want, just change the source data this
11 Computer 44
44 Fantasy 5
now try below steps:
select xpath(xmldata, '/catalog/book/id/text()')as id,
xpath(xmldata, '/catalog/book/genre/text()')as genre,
xpath(xmldata, '/catalog/book/price/text()')as price FROM xmltable;
now you will get ans as like this:
["11"] ["Computer"] ["44"]
["44"] ["Fantasy"] ["5"]
if you apply xapth_string, xpath_int, xpath_int udfs the you will get ans like
11 computer 44
44 Fantasy 5.
Thanks