xml - 为什么 Apache Hive XPath 只返回第一个匹配项?

标签 xml hadoop xpath hive

我需要一些使用 Hive 的 XML 方面的帮助。

我有一个包含 XML 内容的配置单元字符串列,我需要返回所有出现的特定标记。

我正在使用 xpath_string(columnname, '//tagname/text()'),但它只返回第一次出现的标签。

是否可以返回所有 XML 格式的标签?

最佳答案

根据 Apache Hive documentation , 而不是 xpath_string(),

xpath_string

The xpath_string() function returns the text of the first matching node.

使用xpath():

xpath

The xpath() function always returns a hive array of strings.

如果您想要的不仅仅是第一个匹配节点的文本。

关于xml - 为什么 Apache Hive XPath 只返回第一个匹配项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49255358/

相关文章:

android - 早于 4.2 的 android 中从右到左的元素方向

hadoop - 由于 AM 容器 : exited with exitCode: 1,应用程序失败 2 次

要打开的 Hadoop 3.1.0 端口

php - PHP XPath:将查询结果评估为整数

javascript - 如何在 XML 元素内的 URL 中转义 '&'

java - 解析 xml 时出错 : unbound prefix from com. google.android.gms.ads.AdView

javascript - 无法读取 null 的属性 'getElementsByTagName'

hadoop - 当要插入hdfs的数据大于datanode的容量时会发生什么

powershell - 如何使用 PowerShell 删除 XML 节点?

c# - .NET : How do you remove a specific node from an XMLDocument using XPATH?