读取配置单元中的嵌套标记xml文件

20jt8wwn  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(345)

我有以下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

bpzcxfmw

bpzcxfmw1#

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>;

希望这会有帮助。。

相关问题