【发布时间】:2016-11-09 14:59:50
【问题描述】:
我有一个xml文档如下:
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
在 hive 上,我可以使用 xpath 使用以下命令检索 XML 文档中每个节点的文本:
select xpath(xml_text,'//*[name()='note']//text()') from table_test;
但是,我无法确定在 Hive 上使用哪个 XPATH 命令来检索文本的 XML 节点名称
对于上面的例子,我希望能够返回
["to","from","heading","body"],表示 XML 文件中标记的 XML 节点。
任何帮助表示赞赏。
【问题讨论】: