我有以下xml文件
<rec><name><fname>Ravi</fname><lname>kumar</lname></name>
<age>25</age><contact>
<email><personal>ravi@gmail.com</personal>
<official>ravi@infy.com</official></email>
<phone><mobile>12345</mobile>
<office>12346</office>
<residence>12347</residence></phone></contact></rec>
如何阅读嵌套标签!!我是hive的新手
答案 0 :(得分:0)
select xpath_string(line,'rec/name/fname'),xpath_string(line,'rec/name/lname'),xpath_int(line,'rec/age'),
...........................................
xpath_string(line,'rec/contact/phone/residence') from <table_name>;
希望这会有所帮助..